# Radio Group ## Example ```svelte
Selected: {value} With descriptions
Plan: {plan} ``` ## Documentation ## Usage A set of radio buttons where exactly one can be selected at a time. The simplest way is to pass an `options` array — items, labels, and spacing are handled for you: ```svelte ``` ## With descriptions Each option can carry an optional `description`: ```svelte ``` ## Horizontal layout ```svelte ``` ## Custom rendering For full control, skip `options` and compose with `RadioGroupItem`: ```svelte ``` ## Sources This component uses the bits-ui component: RadioGroup, see here for the documentation for that: https://bits-ui.com/docs/components/radio-group/llms.txt ## API Reference ### RadioGroup A set of radio buttons where exactly one can be selected. Pass an `options` array for the common case, or use `RadioGroupItem` as children for custom layouts. | Prop | Type | Default | Description | |------|------|---------|-------------| | value | `string` | `''` | The currently selected value. (bindable) | | options | `RadioGroupOption[]` | `-` | Array of options rendered as radio items with labels. Each option is `{ value, label?, description?, disabled? }`. Omit to compose children manually. | | variant | `'primary' | 'secondary'` | `'primary'` | Color variant applied to every item. | | sizeVariant | `'default' | 'sm' | 'lg'` | `'default'` | Size applied to every item. | | orientation | `'vertical' | 'horizontal'` | `'vertical'` | Layout direction when rendering the options array. | | disabled | `boolean` | `-` | Disable the entire group. | | onValueChange | `(value: string) => void` | `-` | Callback when the selected value changes. | | children | `Snippet` | `-` | Custom content (e.g. `RadioGroupItem`s). Ignored if `options` is provided. | | class | `string` | `-` | Additional CSS classes on the group container. | ### RadioGroupItem A single radio item. Use when composing a custom layout. | Prop | Type | Default | Description | |------|------|---------|-------------| | value | `string` | `-` | The value represented by this item. (required) | | variant | `'primary' | 'secondary'` | `'primary'` | Color variant. | | sizeVariant | `'default' | 'sm' | 'lg'` | `'default'` | Size of the radio circle. | | disabled | `boolean` | `-` | Disable this item. | | id | `string` | `-` | HTML id used to associate an external `