A radio group allows a user to select a single item from a list of mutually exclusive options.
Prop | Type | Default | Responsive |
---|---|---|---|
size | smallmedium | small | Yes |
label | string | - | No |
icon | ReactNode | - | No |
description | string | - | No |
name | string | - | No |
className | string | - | No |
style | CSSProperties | - | No |
Here's a simple TextField with a description.
<RadioGroup label="Label" orientation="horizontal" />
You can disable the entire radio group by adding the isDisabled
prop to the RadioGroup
component.
<RadioGroup label="Label" isDisabled>
<Radio value="bulbasaur">Bulbasaur</Radio>
<Radio value="charmander">Charmander</Radio>
<Radio value="squirtle">Squirtle</Radio>
</RadioGroup>
You can disable a single radio by adding the isDisabled
prop to the Radio
component.
<RadioGroup label="Label">
<Radio value="bulbasaur">Bulbasaur</Radio>
<Radio value="charmander" isDisabled>Charmander</Radio>
<Radio value="squirtle">Squirtle</Radio>
</RadioGroup>
Here's an example of a radio group with errors.
<RadioGroup validate: value => (value === 'charmander' ? 'Nice try!' : null)>
<Radio value="bulbasaur">Bulbasaur</Radio>
<Radio value="charmander">Charmander</Radio>
<Radio value="squirtle">Squirtle</Radio>
</RadioGroup>
You can make the radio group read only by adding the isReadOnly
prop to the RadioGroup
component.
<RadioGroup label="Label" isReadOnly>
<Radio value="bulbasaur">Bulbasaur</Radio>
<Radio value="charmander">Charmander</Radio>
<Radio value="squirtle">Squirtle</Radio>
</RadioGroup>