Skip to content

RadioGroup

RadioGroup presents a visible set of mutually exclusive choices. It is best when users benefit from comparing every option before choosing one.

RadioGroup states Open in Storybook

When To Use

Use RadioGroup for short lists, usually two to five choices. Use Select when the list is longer, the choice is secondary, or space is limited.

tsx
<RadioGroup
  label='Billing interval'
  value={interval}
  onValueChange={setInterval}
  orientation='horizontal'
  color='primary'
>
  <Radio value='monthly' label='Monthly' />
  <Radio value='yearly' label='Yearly' description='Save 20%.' />
</RadioGroup>

API Shape

Use value with onValueChange for controlled groups, or defaultValue for uncontrolled groups. size and color can be set on RadioGroup and inherited by child Radio controls. Individual Radio items can override them.

RadioGroup spacing and Radio item sizing, typography, color states, focus rings, and selected/pressed motion are driven by component tokens. Prefer size and color props over custom dimensions or hardcoded colors.

Standalone Radio uses the same token contract as RadioGroup items. size controls the visual control, indicator, label typography, and description typography; color controls selected, hover, pressed, focus, invalid, disabled, and selected-disabled states.

tsx
<RadioGroup label='Status' color='danger' defaultValue='blocked'>
  <Radio value='blocked' label='Blocked' />
  <Radio value='active' label='Active' color='success' />
</RadioGroup>

Use icon only when the default dot does not match the product language.

tsx
<Radio
  value='approved'
  label='Approved'
  color='success'
  checked
  icon={<span aria-hidden='true'>✓</span>}
/>

Props

PropPurpose
valueControlled selected value on RadioGroup or item value on Radio.
defaultValueInitial selected value for uncontrolled RadioGroup.
onValueChangeReceives the next selected RadioGroup value.
checkedControlled checked state for standalone Radio.
defaultCheckedInitial standalone Radio checked state.
onCheckedChangeReceives standalone checked changes.
sizesm, md, or lg.
colorprimary, neutral, success, warning, or danger.
labelVisible group or item label.
descriptionSupporting group or item text.
errorValidation message and invalid state.
requiredMarks the group or standalone Radio as required.
disabledDisables the group or individual Radio item.
orientationvertical or horizontal on RadioGroup.
iconCustom selected indicator on Radio.
wrapperClassNameClickable Radio row class name on web.

Layout Guidance

LayoutUse For
VerticalPlan selection, settings, choices with descriptions.
HorizontalTwo or three short labels in compact forms.
Disabled groupEntire unavailable setting controlled by account or permission state.
Disabled itemA specific option that exists but cannot currently be selected.

Controlled State

Use controlled state when the selected value affects other fields, pricing, or validation.

tsx
const [plan, setPlan] = useState('pro');

<RadioGroup label='Plan' value={plan} onValueChange={setPlan}>
  <Radio value='starter' label='Starter' />
  <Radio value='pro' label='Pro' />
  <Radio value='enterprise' label='Enterprise' />
</RadioGroup>;

Real Example: Billing Interval

tsx
import { Button, Radio, RadioGroup } from '@vellira-ui/react';
import { useState } from 'react';

export function BillingIntervalForm() {
  const [interval, setInterval] = useState('yearly');

  return (
    <form onSubmit={updateBilling}>
      <RadioGroup
        label='Billing interval'
        description='Choose how often this workspace is billed.'
        value={interval}
        onValueChange={setInterval}
        orientation='vertical'
      >
        <Radio value='monthly' label='Monthly' description='$29 per seat.' />
        <Radio
          value='yearly'
          label='Yearly'
          description='$290 per seat. Includes two months free.'
        />
      </RadioGroup>
      <Button type='submit'>Update billing</Button>
    </form>
  );
}

Accessibility

  • Provide a group label whenever the options are not self-explanatory.
  • Use descriptions for options with meaningful tradeoffs.
  • Do not hide all options behind a custom visual card without preserving radio semantics.
  • Keep keyboard order the same as visual order.

See Also

  • Select for compact or longer lists.
  • Checkbox for independent boolean choices.

Built for Vellira Design System.