VDS

Radio

Single selection from multiple options.

Installation

npx @vds-testing/cli add radio
npx @vds-testing/cli add radio

Usage

import { RadioGroup, RadioGroupItem } from "@/components/vds/radio"
<RadioGroup name="options" defaultValue="one">
  <div class="flex items-center gap-3">
    <RadioGroupItem value="one" id="option-one" />
    <Label for="option-one">Option One</Label>
  </div>
  <div class="flex items-center gap-3">
    <RadioGroupItem value="two" id="option-two" />
    <Label for="option-two">Option Two</Label>
  </div>
</RadioGroup>

Labels use vds-paragraph-regular via the Label component. The selected indicator uses --color-brand. Focus uses focus-shape.

Examples

Horizontal

With description

Default spacing for most users.

Reduced spacing for power users.

Disabled

Non-clickable radios use the disabled state. The control and indicator switch to --color-muted-foreground (dark gray).

Single item disabled

Standalone Radio

Anatomy

  • RadioGroup - Container that manages the radio group state
  • RadioGroupItem - Individual radio button within a group
  • Radio - Standalone radio input for simple use cases
  • Label - Option text using vds-paragraph-regular

Props

RadioGroup

Prop Type Default Description
name string - Required. Groups radio buttons together
defaultValue string - Initially selected value
disabled boolean false Makes all items non-clickable with dark gray styling
required boolean false Makes selection required
orientation “horizontal” | “vertical” “vertical” Layout direction
class string - Additional CSS classes

RadioGroupItem

Prop Type Default Description
value string - Required. Form value when selected
id string - Element ID for label association
disabled boolean false Non-clickable; uses --color-muted-foreground
checked boolean false Controlled checked state
class string - Additional CSS classes

Radio

Prop Type Default Description
id string - Element ID for label association
name string - Groups radio buttons together
value string - Form value when selected
checked boolean false Default checked state
disabled boolean false Non-clickable; uses --color-muted-foreground
required boolean false Makes selection required
class string - Additional CSS classes

Focus

Radios use focus-shape (yellow/black double ring) on keyboard focus.