Skip to Content
DocumentationRadioGroup

RadioGroup

Displays a radio group.

Examples

Regular

Disabled

API

Root

Contains all the parts of a radio group.

PropertyTypeDefaultDescription
asChildbooleanfalseChange the default rendered element for the one passed as a child, merging their props and behavior.
defaultValuestring-The value of the radio item that should be checked when initially rendered. Use when you do not need to control the state of the radio items.
valuestring-The controlled value of the radio item to check. Should be used in conjunction with onValueChange.
onValueChange(open: string) => void-Event handler called when the value changes.
disabledboolean-When true, prevents the user from interacting with radio items.
namestring-The name of the group. Submitted with its owning form as part of a name/value pair.
requiredboolean-When true, indicates that the user must check a radio item before the owning form can be submitted.
orientation”horizontal” | “vertical” | undefinedundefinedThe orientation of the component.
dir”ltr” | “rtl”-The reading direction of the radio group. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode.
loopbooleantrueWhen true, keyboard navigation will loop from last item to first, and vice versa.
Data attributeValues
[data-disabled]Present when disabled

Item

An item in the group that can be checked. An input will also render when used within a form to ensure events propagate correctly.

PropertyTypeDefaultDescription
asChildbooleanfalseChange the default rendered element for the one passed as a child, merging their props and behavior.
valuestring-The value given as data when submitted with a name.
disabledboolean-When true, prevents the user from interacting with radio items.
requiredboolean-When true, indicates that the user must check a radio item before the owning form can be submitted.
variant”regular""regular”The visual style of the radio item.
size”sm” | “md” | “lg""md”The size of the radio item.
Data attributeValues
[data-state]“checked” | “unchecked”
[data-disabled]Present when disabled
Last updated on