Skip to content

RadioGroup

A controlled radio group for single-value selection.

Notification preference
Best for detailed updates.
<RadioGroup
label="Notification preference"
description="Choose one delivery channel."
htmlName="notificationPreference"
value="email"
/>
Notification preference
Best for detailed updates.
<RadioGroup
label="Notification preference"
description="Choose one delivery channel."
htmlName="notificationPreference"
value="email"
orientation="horizontal"
/>
Notification preference
Best for detailed updates.
<RadioGroup
label="Notification preference"
description="Choose one delivery channel."
htmlName="notificationPreference"
value="email"
size="sm"
/>
Notification preference
Best for detailed updates.
<RadioGroup
label="Notification preference"
description="Choose one delivery channel."
htmlName="notificationPreference"
value="email"
size="lg"
/>
Notification preference
Best for detailed updates.
<RadioGroup
label="Notification preference"
description="Choose one delivery channel."
htmlName="notificationPreference"
value="email"
isDisabled
/>
Notification preference
Best for detailed updates.
<RadioGroup
label="Notification preference"
description="Choose one delivery channel."
htmlName="notificationPreference"
value="email"
isReadOnly
/>
Notification preference
function ItemDisabledStory(args: RadioGroupProps): React.JSX.Element {
const [value, setValue] = useState(args.value);
return (
<RadioGroup {...args} onChange={setValue} value={value}>
<RadioGroupItem label="Email" value="email" />
<RadioGroupItem isDisabled label="SMS" value="sms" />
<RadioGroupItem label="Push" value="push" />
</RadioGroup>
);
}
<ItemDisabledStory {...args} />
Notification preferenceRequired
Best for detailed updates.
<RadioGroup
label="Notification preference"
description="Choose one delivery channel."
htmlName="notificationPreference"
value="email"
isRequired
/>
Notification preferenceOptional
Best for detailed updates.
<RadioGroup
label="Notification preference"
description="Choose one delivery channel."
htmlName="notificationPreference"
value="email"
isOptional
/>
Notification preference
Best for detailed updates.
<RadioGroup
label="Notification preference"
description="Choose one delivery channel."
htmlName="notificationPreference"
value="email"
status={{message: 'Select a notification preference.', type: 'error'}}
/>
Notification preference
Recommended
function WithEndContentStory(args: RadioGroupProps): React.JSX.Element {
const [value, setValue] = useState(args.value);
return (
<RadioGroup {...args} onChange={setValue} value={value}>
<RadioGroupItem
endContent={<Badge color="blue" label="Recommended" />}
label="Email"
value="email"
/>
<RadioGroupItem label="SMS" value="sms" />
<RadioGroupItem label="Push" value="push" />
</RadioGroup>
);
}
<WithEndContentStory {...args} />
Notification preference
function WithIconsStory(args: RadioGroupProps): React.JSX.Element {
const [value, setValue] = useState(args.value);
return (
<RadioGroup {...args} onChange={setValue} value={value}>
<RadioGroupItem
label="Email"
startContent={<Icon color="secondary" icon={Mail} size="sm" />}
value="email"
/>
<RadioGroupItem
label="SMS"
startContent={<Icon color="secondary" icon={MessageSquare} size="sm" />}
value="sms"
/>
<RadioGroupItem
label="Push"
startContent={<Icon color="secondary" icon={Bell} size="sm" />}
value="push"
/>
</RadioGroup>
);
}
<WithIconsStory {...args} />
Notification preference
Best for detailed updates.
SMS may incur carrier charges.
<RadioGroup
label="Notification preference"
description="Choose one delivery channel."
htmlName="notificationPreference"
value="email"
status={{message: 'SMS may incur carrier charges.', type: 'warning'}}
/>
Notification preference
Best for detailed updates.
Preference saved.
<RadioGroup
label="Notification preference"
description="Choose one delivery channel."
htmlName="notificationPreference"
value="email"
status={{message: 'Preference saved.', type: 'success'}}
/>

A controlled radio group for single-value selection.

When isOptional: false, isRequired: false

PropTypeDefaultDescription
children*ReactNode—Radio list items to render.
classNamestring—Additional CSS class names applied to the field root.
data-testidstring—Test ID applied to the field root.
descriptionReactNode—Supporting text displayed below the label.
htmlNamestring—HTML name attribute shared by radio inputs for native form submission.
isDisabledbooleanfalseWhether all radio items are disabled.
isReadOnlybooleanfalseWhether the selected value can be changed by the user. Read-only radio items remain enabled for form submission but cannot be focused or activated.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*string—Label text for the radio group.
labelEndReactNode—Content shown at the end of the label row, such as a link. It renders outside the label, so it does not focus the control or change its accessible name. It stays visible when isLabelHidden is true.
labelTooltipReactNode—Tooltip content shown next to the label.
onChange*(value: string) => void—Callback fired when the selected value changes. Memoize with useCallback to avoid unnecessary re-renders of radio items.
orientation"horizontal" | "vertical"'vertical'Layout direction of the radio items.
refRef<HTMLDivElement>—Ref forwarded to the field root.
size"sm" | "md" | "lg"'md'Size of the radio controls.
statusInputStatus—Validation status displayed below the group.
styleCSSProperties—Inline styles applied to the field root.
value*string—The currently selected value.
isOptionalfalse—
isRequiredfalse—

When isOptional: true, isRequired: false

PropTypeDefaultDescription
children*ReactNode—Radio list items to render.
classNamestring—Additional CSS class names applied to the field root.
data-testidstring—Test ID applied to the field root.
descriptionReactNode—Supporting text displayed below the label.
htmlNamestring—HTML name attribute shared by radio inputs for native form submission.
isDisabledbooleanfalseWhether all radio items are disabled.
isReadOnlybooleanfalseWhether the selected value can be changed by the user. Read-only radio items remain enabled for form submission but cannot be focused or activated.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*string—Label text for the radio group.
labelEndReactNode—Content shown at the end of the label row, such as a link. It renders outside the label, so it does not focus the control or change its accessible name. It stays visible when isLabelHidden is true.
labelTooltipReactNode—Tooltip content shown next to the label.
onChange*(value: string) => void—Callback fired when the selected value changes. Memoize with useCallback to avoid unnecessary re-renders of radio items.
orientation"horizontal" | "vertical"'vertical'Layout direction of the radio items.
refRef<HTMLDivElement>—Ref forwarded to the field root.
size"sm" | "md" | "lg"'md'Size of the radio controls.
statusInputStatus—Validation status displayed below the group.
styleCSSProperties—Inline styles applied to the field root.
value*string—The currently selected value.
isOptional*true—
isRequiredfalse—

When isOptional: false, isRequired: true

PropTypeDefaultDescription
children*ReactNode—Radio list items to render.
classNamestring—Additional CSS class names applied to the field root.
data-testidstring—Test ID applied to the field root.
descriptionReactNode—Supporting text displayed below the label.
htmlNamestring—HTML name attribute shared by radio inputs for native form submission.
isDisabledbooleanfalseWhether all radio items are disabled.
isReadOnlybooleanfalseWhether the selected value can be changed by the user. Read-only radio items remain enabled for form submission but cannot be focused or activated.
isLabelHiddenbooleanfalseWhether to visually hide the label.
label*string—Label text for the radio group.
labelEndReactNode—Content shown at the end of the label row, such as a link. It renders outside the label, so it does not focus the control or change its accessible name. It stays visible when isLabelHidden is true.
labelTooltipReactNode—Tooltip content shown next to the label.
onChange*(value: string) => void—Callback fired when the selected value changes. Memoize with useCallback to avoid unnecessary re-renders of radio items.
orientation"horizontal" | "vertical"'vertical'Layout direction of the radio items.
refRef<HTMLDivElement>—Ref forwarded to the field root.
size"sm" | "md" | "lg"'md'Size of the radio controls.
statusInputStatus—Validation status displayed below the group.
styleCSSProperties—Inline styles applied to the field root.
value*string—The currently selected value.
isOptionalfalse—
isRequired*true—

An individual radio option within a `RadioGroup`.

PropTypeDefaultDescription
aria-labelstring—Accessible name applied to the radio input, overriding the label text. Use when a rich label has no useful text. Include any visible label wording.
classNamestring—Additional CSS class names applied to the item root.
data-testidstring—Test ID applied to the item root.
descriptionReactNode—Supporting text displayed below the item label.
endContentReactNode—Content rendered after the label and description.
isDisabledbooleanfalseWhether this radio item is disabled.
label*ReactNode—Label content for the radio item. Supports noninteractive formatting, decorative icons, and badges. Keep links and buttons in the content slots. The label's text supplies the accessible name unless aria-label is set.
refRef<HTMLDivElement>—Ref forwarded to the item root.
startContentReactNode—Content rendered after the radio control and before the label.
styleCSSProperties—Inline styles applied to the item root.
value*string—Value represented by this radio item.