Radio Button
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.
A 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
| Prop | Type | Default | Required |
|---|---|---|---|
as | JSX.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 | - | - |
| Prop | Type | Default | Required |
|---|---|---|---|
aria-label | string | - | - |
as | JSX.IntrinsicElements | - | - |
asChild | boolean | - | - |
checked | boolean | - | - |
required | boolean | - | - |
size | Partial<Record<Breakpoint, "md" | "lg">> | "md" | "lg" | - | - |
value | string | - |