Radio

Single-select options, managed by a group with automatic name wiring.

Selected plan: pro

Import#

import { Radio } from "astralis-ui";
// Radio.Group

Usage#

Always wrap radios in Radio.Group — it holds the selected value, shares one auto-generated name so the browser treats them as a set, and fires onChange(value) with the plain string.

Orientation, sizes and states#

Props#

PropTypeDefaultDescription
valuestring | numberRequired; identifies the option.
size"sm" | "md" | "lg""md"Circle size.
colorSchemeall 11 schemes"brand"Selected hue.
invalid / disabled / readOnlybooleanfalseState flags — inherited from Field.

Radio.Group#

PropTypeDefaultDescription
value / defaultValue / onChangestring / string / (value: string) => void— / "" / —The selected value.
namestringautoHTML name shared by the set.
orientation"horizontal" | "vertical""vertical"Layout.
colorScheme / disabledShared defaults for every child.

Keyboard#

KeyAction
TabInto the group — one tab stop (the selected option)
/ Move selection between options
SpaceSelect the focused option (when none is selected yet)

Accessibility#

The group renders role="radiogroup" over real <input type="radio"> elements — arrow-key movement between options is native browser behavior.