Forms
Radio Group
Lets someone choose one option from a labelled group.
Use RadioGroup when someone must choose one value from a set of options. Pass a label to name
the group, then add a RadioField for each option.
Options
Pass a value to each RadioField. Each option can have a description beneath its label. Use
orientation="horizontal" for a short set of options that fits in a row. The default orientation is
vertical, and a horizontal group wraps when it runs out of space.
Selection
Use defaultValue for an uncontrolled initial choice. Pair value with onChange when application
state owns the choice. The selected option's value is submitted with the group's name.
Size
Set size on the group to size every option. Set it on a RadioField to override the group size.
The size does not change option label typography. When neither sets a size, the group inherits
Form.controlSize or uses medium.
Validation
Set isRequired when the group needs a choice before the form submits. Pass validate for a custom
rule. Pass errorMessage for an error from a form library or server. A non-empty message marks the
group invalid and shows one message beneath its options. The group description remains visible when
the group is invalid. Read Validation for where messages come from and how to
write them.
By default, a required group shows a marker after its label. Read
Required fields for the necessityIndicator values.
Submit without choosing an option to see the validation message.
Accessibility
Give the group a visible label, or use aria-label or aria-labelledby when another part of the
layout already names it. Use RadioField for each option so its visible label and optional
description stay connected to its radio control. The group supports arrow-key navigation. Disabled
groups keep their options disabled even if an individual option sets isDisabled={false}.
For a custom layout, compose the Radio primitive.
API
RadioGroupProps
RadioGroupProps also accepts compatible DOM and ARIA attributes and event handlers for its rendered element.
RadioFieldProps
RadioFieldProps also accepts compatible DOM and ARIA attributes and event handlers for its rendered element.