Components / Choice

RadioGroup

A group of radio buttons, vertical or horizontal. Extra attributes go to the fieldset; an option's attrs go to its native radio input, which overlays the visible dot.

@ruckc/truss-ui Choice

Import

import { RadioGroup } from '@ruckc/truss-ui';

Playground

orientation
value

API

Also accepts every attribute of HTMLFieldsetAttributes, applied to the underlying element.

PropTypeDefaultDescription
options required { value: string; label: string; disabled?: boolean; attrs?: Record<string, string> }[]—`attrs` are spread onto that option's native radio input (e.g. `data-testid`).
value bindable string—The current value. Bind it with `bind:value`.
label string—Visible label shown above the control.
orientation 'vertical' | 'horizontal''vertical'Layout direction.
disabled booleanfalseDisables the control: it cannot be focused, changed or activated.
/docs/radio-group Truss UI · MIT