RadioGroup
Choose one value from a visible set of radio options.
Use RadioGroup for one choice from a small visible set. For a longer or space-constrained collection, use Select.
Basic usage#
Playground#
Props
Slots
Anatomy#
Usage#
Single selection#
Use one string value for the selected item and pair value with onValueChange for controlled state. Disabled items remain visible but cannot be selected. The group uses radio keyboard behavior rather than the independent focus order of checkboxes.
Forms#
Set name for native form submission. For schema binding and validation, place the group inside
form.Field from createForm. Standalone Field supplies
labels and messages without binding a form store.
Keyboard interaction#
| Key | Description |
|---|---|
| ↓ / → | Moves focus and selection to the next enabled radio item. |
| ↑ / ← | Moves focus and selection to the previous enabled radio item. |
| Space | Selects the focused radio item. |
| ⇥ | Enters or leaves the group according to normal focus order. |
Examples#
Controlled value and disabled items#
Indicator position#
Form integration#
Attributes#
Attributes
data-disabledSlot: radio-group, radio-group-item, radio-group-controlDescription: Present when the component, slot, or item is disabled.data-invalidSlot: radio-group, radio-group-controlDescription: Present when the field or form has a validation error.data-readonlySlot: radio-group, radio-group-controlDescription: Present when the field is in read-only mode.data-requiredSlot: radio-group, radio-group-controlDescription: Present when the field input is required.data-checkedSlot: radio-group-item, radio-group-control, radio-group-indicatorDescription: Present when the item or toggle is checked.Props#
Props for the RadioGroup component. Renders a <div> element by default.
Prop