<Radio
name="option"
label="Option 1"
value="option1"
defaultChecked={false}
checked={false}
error={false}
icons={{ checked: CheckIcon, unchecked: UncheckIcon }}
onChange={(e, state) => console.log(state)}
/>
Radio Props
In addition to the props listed below, the Radio component can accept any valid HTML input props.onChange
(e: ChangeEvent, state: { checked: boolean; value: string | string[] | number }) => void
required
Callback when the radio is changed.
Controlled checked state.
Uncontrolled checked state.
Description text to display below the radio.
Error state for the radio.
icons
{ checked?: Svg; unchecked?: Svg }
Overrides for default icons.
The label should have accessible string content.
<Radio.Group
legend="Select an option"
moreInfo="Additional information"
required={false}
>
<Radio name="option" label="Option 1" />
<Radio name="option" label="Option 2" />
</Radio.Group>
Radio.Group Props
In addition to the props listed below, the Radio.Group component can accept any valid HTML fieldset props.legend
ReactElement | string
required
The legend for the radio group.
Displays in a tooltip at the legend.