✦ Asteria UI
Components

Radio Group

Group of mutually exclusive radio options, built on Radix UI.

Installation

npx asteria-ui add radio-group

Usage

import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";

<RadioGroup defaultValue="free" aria-label="Plan">
  <RadioGroupItem value="free" label="Free" />
  <RadioGroupItem value="pro" label="Pro" />
</RadioGroup>

Examples

Disabled

API reference

RadioGroup

PropTypeDefaultDescription
valuestringControlled selected value.
defaultValuestringUncontrolled initial selected value.
onValueChange(value: string) => voidCalled when the selection changes.
disabledbooleanDisables every item in the group.

RadioGroupItem

PropTypeDefaultDescription
valuestringThis item's value within the group.
labelReactNodeClickable label, linked to the control via for/id.
disabledbooleanDisables this item only.

Accessibility

Accessibility

  • Role. role="radiogroup", each item role="radio" — provided by Radix.

  • Keyboard. Arrow keys move roving focus between items; Space (or a click) selects the focused one. In this Radix version, arrow-key navigation moves focus without auto-selecting — verified directly rather than assumed, since some Radix components (like Tabs) do auto-select on arrow-key move and some don't.

  • Label. Clicking a label selects that item.