The RadioButton component implements the Radio component from Radix with default styling.

It needs to be wrapped with the RadioButtonGroup as it will not load without it. If only one RadioButton is needed please consider using a checkbox instead.

RadioButton needs to be associated with a label for accessibility purposes and to display the text for it. So rather than using the RadioButton component directly in a UI, consider using a RadioButtonField, which provides a Label and displays validation errors. Use this RadioButton to compose more complex Field type components.

API Reference

RadioButtonGroup
PropTypeDefaultRequired
asJSX.IntrinsicElements--
asChild
boolean
--
defaultValue
string
--
dir
"ltr" | "rtl"
--
direction
"row" | "column"
--
disabled
boolean
--
loop
boolean
--
name
string
--
onValueChange
(value: string) => void
--
orientation
"horizontal" | "vertical"
--
required
boolean
--
value
null | string
--
RadioButton
PropTypeDefaultRequired
aria-label
string
--
asJSX.IntrinsicElements--
asChild
boolean
--
checked
boolean
--
required
boolean
--
size
Partial<Record<Breakpoint, "md" | "lg">> | "md" | "lg"
--
valuestring-