# RadioGroup (@limerdev/zest) A set of radio buttons with `bind:value`: `` holds one `RadioGroup.Item` per option. Tab enters the group, arrow keys move and select. Put each item in a `Field orientation="horizontal"` with a `Field.Label`, and the group in a `Field.Set` with a `Field.Legend` that names it. - Category: Data input - Import: `import { RadioGroup } from '@limerdev/zest'` - Bits UI: `RadioGroup`, https://bits-ui.com/docs/components/radio-group - Exports: `RadioGroup.Root`, `RadioGroup.Item` - Use for: Choosing exactly one of a few options (up to about six) that should all be visible. - Don't: Many options, or options that don't fit on screen: use `Select`. Independent on/off choices: use `Checkbox`. A group without a `Field.Legend` (or `aria-label`). ```svelte Billing Monthly Yearly ``` Props of `RadioGroup.Root`: - `autocomplete` (`FullAutoFill | null`, default `"off"`): The `autocomplete` attribute to forward to the hidden input element. Browsers can otherwise autofill the hidden input with values that don't match any of the radio items. - `disabled` (`boolean`, default `false`): Whether the radio group is disabled. - `loop` (`boolean`, default `true`): Whether to loop around the radio items when navigating with the keyboard. - `name` (`string`, default `undefined`): The name to apply to the radio group's input element for form submission. If not provided, a hidden input will not be rendered and the radio group will not be part of a form. - `onValueChange` (`OnChangeFn`): The callback to call when the selected radio item changes. - `orientation` (`"horizontal" | "vertical"`, default `"vertical"`): The orientation of the radio group. Used to determine how keyboard navigation should work. - `readonly` (`boolean`, default `false`): Whether the radio group is readonly. When readonly, users can focus and navigate through items but cannot change the value. - `required` (`boolean`): Whether the radio group is required for form submission. If `true`, ensure you provide a `name` prop so the hidden input is rendered. - `value` (`string`, default `''`, bindable): The value of the selected radio item. Props of `RadioGroup.Item`: - `disabled` (`null | false | true`, default `false`): Whether the radio item is disabled. - `value` (`string`, required): The value of the radio item. Example: Basic One Field per option; the Field.Legend names the group. Arrow keys move and select. ```svelte Billing Monthly Yearly ``` Example: With descriptions Field.Content puts a description under each option's label. ```svelte Pricing {#each plans as option (option.value)} {option.label} {option.description} {/each} ```