{"slug":"radio-group","name":"RadioGroup","category":"Form & Input","summary":"A set of mutually exclusive options with one selected value.","status":"stable","since":"0.1.0","import":"import { RadioGroup } from '@elluzion/iv-ui';","usage":["`items` accepts strings or `{ value, label, disabled }`.","Bind `value`; `onchange` fires with `{ value }` after a selection changes.","Use `orientation=\"horizontal\"` for compact choice rows."],"props":[{"name":"items","type":"RadioItem[]","default":"[]","description":"Radio options. Strings are used as both value and label.","required":true,"bindable":false},{"name":"value","type":"string","default":"''","description":"Selected value. Bind with `bind:value`.","required":false,"bindable":true},{"name":"label","type":"string","default":"''","description":"Visible label for the control.","required":false,"bindable":false},{"name":"name","type":"string","default":"''","description":"Shared name for the native radio inputs.","required":false,"bindable":false},{"name":"size","type":"'sm' | 'md'","default":"'md'","description":"Control size.","required":false,"bindable":false},{"name":"orientation","type":"'horizontal' | 'vertical'","default":"'vertical'","description":"Layout direction.","required":false,"bindable":false},{"name":"disabled","type":"boolean","default":"false","description":"Disables interaction and applies the disabled treatment.","required":false,"bindable":false}],"events":[{"name":"change","type":"(e: CustomEvent<{ value: string }>) => void","default":null,"description":"Called with `{ value }` after the selection changes.","required":false,"bindable":false}],"snippets":[],"types":[{"name":"RadioItem","kind":"type","code":"type RadioItem = string | { value: string; label?: string; disabled?: boolean };","description":"A radio value or a labelled radio option."}],"manual":[],"tokens":["--iv_border","--iv_control-md","--iv_control-sm","--iv_disabled-opacity","--iv_ease-out","--iv_font-ui","--iv_foreground","--iv_leading-tight","--iv_outline-offset","--iv_outline-width","--iv_radio-border","--iv_radio-dot","--iv_radio-dot-sm","--iv_spacing-2xs","--iv_spacing-sm","--iv_spacing-xl","--iv_surface-raised","--iv_text-body","--iv_text-btn-sm","--iv_text-label","--iv_transition-fast"],"cssHooks":["iv-checked","iv-circle","iv-disabled","iv-dot","iv-group-label","iv-horizontal","iv-item","iv-items","iv-label","iv-md","iv-native","iv-root","iv-sm"],"accessibility":{"keyboard":[["Tab","Moves focus into the group."],["Arrow keys","Move between radios and select the focused one."],["Space","Selects the focused radio."]],"notes":["The group is labelled by `label` through `aria-labelledby`.","Each option is a native radio input inside a `<label>`.","Only the selected radio is in the tab order, matching native behaviour."]},"related":[{"title":"Checkbox","summary":"A binary choice with an optional label and a mixed state.","url":"/components/checkbox","kind":"Component"},{"title":"Switch","summary":"An on/off control that applies immediately.","url":"/components/switch","kind":"Component"},{"title":"Select","summary":"A custom listbox with search, multiple selection, and clearing.","url":"/components/select","kind":"Component"},{"title":"Field","summary":"Labels a custom control and renders its helper or error message.","url":"/components/field","kind":"Component"}],"examples":[{"id":"basic","title":"Basic","description":"A vertical list with one selected value.","code":"<script lang=\"ts\">\n\timport { RadioGroup } from '@elluzion/iv-ui';\n\n\tlet plan = $state('pro');\n</script>\n\n<div class=\"field-row\">\n\t<RadioGroup\n\t\tlabel=\"Plan\"\n\t\titems={[\n\t\t\t{ value: 'free', label: 'Free' },\n\t\t\t{ value: 'pro', label: 'Pro' },\n\t\t\t{ value: 'team', label: 'Team' }\n\t\t]}\n\t\tbind:value={plan}\n\t/>\n\t<p class=\"readout\">selected: {plan}</p>\n</div>\n\n<style>\n\t.field-row {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: var(--iv_spacing-md);\n\t\twidth: 100%;\n\t\tmax-width: 320px;\n\t}\n\n\t.readout {\n\t\tmargin: 0;\n\t\tfont-family: var(--iv_font-mono);\n\t\tfont-size: var(--iv_text-sm);\n\t\tcolor: var(--iv_foreground-dim);\n\t}\n</style>"},{"id":"horizontal","title":"Horizontal","description":"The same group laid out as a row.","code":"<script lang=\"ts\">\n\timport { RadioGroup } from '@elluzion/iv-ui';\n\n\tlet cadence = $state('daily');\n</script>\n\n<div class=\"field-row\">\n\t<RadioGroup\n\t\tlabel=\"Digest cadence\"\n\t\torientation=\"horizontal\"\n\t\titems={['hourly', 'daily', 'weekly']}\n\t\tbind:value={cadence}\n\t/>\n</div>\n\n<style>\n\t.field-row {\n\t\twidth: 100%;\n\t\tmax-width: 420px;\n\t}\n</style>"},{"id":"disabled","title":"Disabled","description":"A disabled option and a fully disabled group.","code":"<script lang=\"ts\">\n\timport { RadioGroup } from '@elluzion/iv-ui';\n\n\tlet plan = $state('pro');\n</script>\n\n<div class=\"field-row\">\n\t<RadioGroup\n\t\tlabel=\"Plan\"\n\t\titems={[\n\t\t\t{ value: 'free', label: 'Free' },\n\t\t\t{ value: 'pro', label: 'Pro' },\n\t\t\t{ value: 'enterprise', label: 'Enterprise — sales only', disabled: true }\n\t\t]}\n\t\tbind:value={plan}\n\t/>\n\t<RadioGroup label=\"Region\" items={['eu-west', 'us-east']} value=\"eu-west\" disabled />\n</div>\n\n<style>\n\t.field-row {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: var(--iv_spacing-xl);\n\t\twidth: 100%;\n\t\tmax-width: 320px;\n\t}\n</style>"}],"markdown":"/components/radio-group.md","page":"/components/radio-group"}