tuix-radio-button
A radio group rendered from a list of options.
One element renders the whole group: it maps options to one radio each.
States
error is ignored while the group is disabled.
Label side
API
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
options | options | (string | number)[] | [] | One radio per entry. Property, or JSON in the attribute |
selectedOption | selectedoption | string | number | null | null | The checked option |
labelSide | labelside | CheckboxLabelSide | right | left or right |
disabled | disabled | boolean | false | Blocks the whole group |
error | error | boolean | false | Red dots and labels. Ignored while disabled |
dark | dark | boolean | false | Dark palette |
Events
| Event | Detail | When |
|---|---|---|
change | { value: string } | Another option is picked |
The detail carries the option as the DOM reports it, so a numeric option arrives
as a string. Typed as CustomEventTuixRadioButton.
The group does not own its selection: the browser checks the radio that was
clicked, but selectedOption stays what the application last set, so write the
new value back in the handler.
Slots
| Slot | Content |
|---|---|
label-{index} | Replaces the label of the option at that index, counting from 0 |
Each element is one complete group. Its inputs do share the name tuix-radio-button, but they sit in the element's
own shadow root, and a native radio group never reaches across two of those, so two tuix-radio-button elements on
a page are independent and need no distinct name. The same boundary is why a single group cannot be split over two
elements: every option of one group belongs in one options array.