Radio

A Material Design 3 radio button for single-choice selection. Pairs with RadioGroup for arrow-key navigable groups with a shared name.

Preview

<script>
  import { Radio, RadioGroup } from '@vultra/md3';

  let selected = $state('option-1');
</script>

<RadioGroup bind:value={selected} name="example">
  <Radio value="option-1">Option 1</Radio>
  <Radio value="option-2">Option 2</Radio>
  <Radio value="option-3" disabled>Option 3 (disabled)</Radio>
</RadioGroup>

Standalone

A Radio can also be used without a group, with its own bindable checked state:

<script>
  import { Radio } from '@vultra/md3';

  let checked = $state(false);
</script>

<Radio bind:checked>Enable feature</Radio>

Props

RadioGroup

PropTypeDefaultDescription
valuestring (bindable)''Currently selected value
namestring''Shared form name for child radios
disabledbooleanfalseDisables the whole group
classstringundefinedAdditional CSS classes
childrenSnippetundefinedRadio children

Radio

PropTypeDefaultDescription
valuestring''Value submitted when selected
checkedboolean (bindable)falseSelection state (when standalone)
disabledbooleanfalseDisables the radio
classstringundefinedAdditional CSS classes
childrenSnippetundefinedLabel content

Accessibility

  • Group renders role="radiogroup" with aria-disabled support
  • Arrow keys move focus and selection between radios

Install

npx @vultra/cli add md3-radio