RadioGroup
Forms & Input

RadioGroup

Manage one selected value across a labeled group of Radio controls.

RadioGroup manages one selected string value across its Radio children. Name the group with aria-label or aria-labelledby.

Import

TSX
import { RadioGroup } from "@solarius/onset";

Props

RadioGroupProps props
PropTypeDefaultDescription
valuestring—Controlled selection. Matched against each Radio's value by equality.
defaultValuestring—Initial uncontrolled selection. Defaults to an empty string with no selected option.
onChange(value: string) => void—Fires with the newly selected value. Re-clicking the selected radio does not fire it.
inlineboolean—Lay radios out in a row instead of stacked. Descriptions still render under their labels, so inline suits short labels.
childrenReactNode—Radio children. Context permits nested wrappers between radios and the group.
classNamestring—Additional CSS class on the role="radiogroup" container.

Example

RadioGroup