Back to Components

Form

RadioGroup

Single-select group of options. Native radio inputs under the hood — keyboard focus, form submission, accessibility built in.

Examples

Vertical

<RadioGroup
  bind:value={theme}
  options={[
    {value: 'light', label: 'Light'},
    {value: 'dark', label: 'Dark'},
    {value: 'auto', label: 'Match system'},
  ]}
  ariaLabel="Theme"
/>

Horizontal

<RadioGroup
  direction="horizontal"
  bind:value={billing}
  options={[
    {value: 'monthly', label: 'Monthly'},
    {value: 'annual', label: 'Annual'},
  ]}
/>

Props

PropTypeDefaultDescription
options{value, label, disabled?}[]Option definitions.
valueTBindable selected value.
onChange(next: T) => voidFires when selection changes.
namestringHTML name attribute (auto-generated if omitted).
direction'vertical' | 'horizontal''vertical'Layout direction.
size'sm' | 'md''md'Radio dot dimension tier.

Install

CLI

npx @a3tai/mittsu add radio-group