Radio Group
Each item renders a native radio input with an optional label and description. Selecting an option fills its ring from the center while the previous choice clears, and with a shared name, arrow keys move the selection within the group.
Installation
Copy the command below and run it in your terminal.
Usage
Bind value on RadioGroup.Root and give it a name. Each item's input id
defaults to radio- plus its value, so
pass id when two groups on one page share values. A description is linked to its input, so screen readers announce it with the option.
Examples
With descriptions
Disabled
Plan selection is locked while billing information is processing.
Anatomy
RadioGroup.Root - Manages a single selection.
RadioGroup.Item - Defines a radio option.
<script lang="ts"> import * as RadioGroup from '@sivir-ui/svelte/components/radio-group'; let value = $state<string | undefined>('default'); </script> <RadioGroup.Root bind:value name="option"> <RadioGroup.Item value="default" label="Default" /> <RadioGroup.Item value="compact" label="Compact" /> <RadioGroup.Item value="detailed" label="Detailed" /> </RadioGroup.Root>