{"name":"radio-group","title":"Radio Group","description":"","kind":"component","category":"inputs","status":"beta","props":{"items":{"type":"array","items":{"value":"string","label":"string","disabled":"boolean?"},"description":"Options in order. Strings are accepted as value = label."},"value":{"type":"string","model":true,"description":"Selected value, or null for none."},"label":{"type":"string","description":"Visible group label; otherwise pass aria-label."},"orientation":{"type":"enum","values":["vertical","horizontal"],"default":"vertical","description":"vertical: stacked options. horizontal: options in a row that wraps."},"layout":{"type":"enum","values":["inline","row"],"default":"inline","description":"inline: each control with its label, sized to the text. row: a list; each option fills a 30px option row (`lib/option.ts`) under one gliding highlight, stacked whatever the orientation; the control is drawn the same."},"disabled":{"type":"boolean","default":false},"name":{"type":"string","description":"Form field name of the radios."},"customPlaceholder":{"type":"string","description":"Row layout: adds the free-text row after the options with this placeholder (e.g. \"Something else…\")."},"customLabel":{"type":"string","description":"Accessible name of the free-text field; defaults to the placeholder."},"customEnterKeyHint":{"type":"enum","values":["enter","done","go","next","previous","search","send"],"attr":"enterkeyhint","part":"custom-input","description":"enterkeyhint of the free-text field: the label of the Enter key on a phone keyboard (\"next\" when another step follows)."},"custom":{"type":"string","model":true,"description":"Text of the free-text row. Typing makes the value null; picking an option makes it empty."}},"playground":{"name":"Playground","props":{"items":[{"value":"private","label":"Private: only members of web-app"},{"value":"internal","label":"Internal: everyone at Northwind"},{"value":"public","label":"Public: anyone with the link"}],"value":"internal","label":"Who can see web-app"}},"exampleFiles":[{"file":"project-visibility","title":"Project visibility"},{"file":"billing-cycle","title":"Billing cycle, in a row"},{"file":"cancel-reason","title":"Why are you cancelling (rows, with free text)"},{"file":"log-retention","title":"Log retention, one option not on your plan"},{"file":"region","title":"Pick a region (no default)"}],"worstCase":[{"name":"Long labels","width":240,"props":{"items":[{"value":"a","label":"Automatically approve every edit the agent proposes to supplier records"},{"value":"b","label":"maximilian.wisniewska-kowalczyk@example-supplier-network.com"},{"value":"c","label":"A"}],"value":"a","label":"When the agent proposes an edit to a record that another person is reviewing right now"}},{"name":"Many in a row","width":280,"props":{"items":["Mon","Tue","Wed","Thu","Fri","Sat","Sun","Every weekday"],"value":"Wed","orientation":"horizontal","aria-label":"Day"}},{"name":"Right to left","props":{"items":[{"value":"day","label":"يومي"},{"value":"week","label":"أسبوعي"},{"value":"month","label":"شهري"}],"value":"week","label":"الملخص"}},{"name":"Rows with long labels","width":240,"props":{"items":[{"value":"a","label":"Automatically approve every edit the agent proposes to supplier records"},{"value":"b","label":"maximilian.wisniewska-kowalczyk@example-supplier-network.com"},{"value":"c","label":"A"}],"value":"b","layout":"row","customPlaceholder":"Something else entirely, described in my own words…","aria-label":"Worst case"}},{"name":"One option","props":{"items":["Only option"],"value":"Only option","aria-label":"Single"}}],"anatomy":[{"part":"root","element":"div","description":"role=radiogroup; data-orientation=vertical|horizontal; data-disabled Wrapper rule: class and style land on this outermost element (what a caller sizes and places); every other attribute stays on the control."},{"part":"label","element":"span","optional":true,"description":"Visible group label; names the group"},{"part":"highlight","element":"span","optional":true,"description":"Row layout only: the list's one gliding highlight (`glideLayer` of `lib/glide.ts`, aria-hidden); it follows the pointer and keyboard focus."},{"part":"item","element":"label","repeat":true,"description":"One option and its hit area; data-state=checked|unchecked, data-focus-visible, data-disabled. In row layout it composes the shared option row (`lib/option.ts`)."},{"part":"control","element":"div","description":"The 16px round control (aria-hidden); one inset ring draws both states (no dot element); carries kbd-instant"},{"part":"item-text","element":"span","description":"The option's text and accessible name"},{"part":"input","element":"input","description":"Native radio, visually hidden: focus, arrow keys and form value"},{"part":"custom","element":"label","optional":true,"description":"Row layout only: the free-text row (\"Something else\") after the options, in the same list; it composes the shared option row (`lib/option.ts`)."},{"part":"custom-input","element":"input","optional":true,"description":"The free-text field: type=text, named by aria-label. Typing clears the selection; picking an option clears it."}],"events":{"valueChange":"(value: string | null)","customChange":"(text: string)"},"states":["checked","hover","press","focus-visible","disabled","kbd-instant","reduced-motion","row","custom"],"tokens":["color.ink","color.ink-2","color.ink-3","color.on-ink","color.line-strong","color.accent","text.xs","text.sm","duration.fast","duration.base","duration.press","easing.out-strong","motion.press-scale-sm","text.md"],"a11y":{"role":"radiogroup","keyboard":["Tab reaches the selected option (or the first, when none is selected); the group is one tab stop","ArrowDown / ArrowRight select the next enabled option, ArrowUp / ArrowLeft the previous; they wrap","Home / End select the first / last enabled option","Space selects the focused option","Row layout: Tab from the group reaches the free-text field, which keeps Home / End for its text"],"notes":["Give the group a visible label or an aria-label.","Disabled options are skipped by the arrow keys.","To select from outside, control `value` (null clears): React value / onValueChange, Vue v-model:value, Svelte bind:value."]},"motion":["select: one property, the inset ring, grows from 1.5px line-strong to 5px ink over duration.base with easing.out-strong, so the on-ink centre forms as the ring closes in","deselect: the ring runs back over duration.fast; when the selection moves, the old option empties while the new one fills, both from the same moment","press (pointer only): the control scales to motion.press-scale-sm over duration.press with easing.out-strong","keyboard (arrows, Space, Home, End): instant; every control carries kbd-instant and the label colour is instant too","mount: nothing animates on the first paint, in every target","reduced motion: the ring keeps its width and only changes colour over duration.fast; the press stays","row layout: one glide highlight (`glideLayer` of `lib/glide.ts`) travels to the hovered or focused row (duration.move, easing.out-strong; first appearance fades in); press darkens the row (hover-2) and scales the control as above"]}