Radio
Pick one value from a short, visible set. Switch in this port is a segmented control — use Radio for classic radio buttons.
Default
RadioGroup renders a fieldset. RadioGroupItem wraps each option in a label.
Disabled
disabled on the group locks every option. On an item it greys out one choice.
1
<RadioGroup v-model='plan' label='Plan' disabled class='gap-3'>
2
<RadioGroupItem value='hobby'>Hobby</RadioGroupItem>
3
<RadioGroupItem value='pro'>Pro</RadioGroupItem>
4
</RadioGroup>
6
<RadioGroup v-model='itemDisabled' label='Plan' class='gap-3'>
7
<RadioGroupItem value='hobby'>Hobby</RadioGroupItem>
8
<RadioGroupItem value='pro'>Pro</RadioGroupItem>
9
<RadioGroupItem value='enterprise' disabled>Enterprise</RadioGroupItem>
10
</RadioGroup>
Required
Put required on RadioGroup, not on a single item. Native constraint validation then blocks submit.
1
<form @submit.prevent>
2
<RadioGroup v-model='requiredCycle' label='Billing Cycle' required class='gap-3'>
3
<RadioGroupItem value='monthly'>Monthly</RadioGroupItem>
4
<RadioGroupItem value='yearly'>Yearly</RadioGroupItem>
5
</RadioGroup>
6
<Button size='small' type-name='submit'>Submit</Button>
7
</form>
Headless
useRadio returns a Radio bound to a value so you can own the label layout.
Standalone
Bare Radio for custom rows. It needs an accessible name and you own checked state.
Best practices
- Two to six mutually exclusive choices that should stay on screen. Past that, use
SelectorCombobox. - On/off is
Toggle. Two or three compact peers in a pill isSwitch. Radio is the circular control. - Pre-select the safe default so the field looks configured. Leave it empty only when the pick has real consequences.
- Group label is a Title Case noun (
Deployment Region). Option labels stay parallel:Monthly/Yearly. requiredbelongs onRadioGroup. A single required radio is meaningless.- A disabled option needs a reason nearby. A grey circle with no copy reads as broken.
- Standalone
Radioalways getsaria-labelor a wired<label>.