Atomx Docs
Components

Radio Group

A set of checkable buttons where only one option can be selected at a time, built on Radix UI's RadioGroup primitive.

Install

npx shadcn@latest add https://atomx.acau.net/r/radio-group.json

Usage

Use RadioGroup when the user must pick exactly one option from a small, visible set (typically 2–5). For longer lists or when collapsing the options behind a trigger is preferable, use Select instead. For multi-select, use Checkbox.

Wrap each option in a RadioGroupItem with a unique value and pair it with a Label via htmlFor.

Preview

Default with a preselected value

Disabled option

Props

RadioGroup

Extends React.ComponentProps<typeof RadioGroupPrimitive.Root>. All Radix RadioGroup props are forwarded.

PropTypeNotes
valuestringControlled value of the selected radio item.
defaultValuestringInitial value for uncontrolled usage.
onValueChange(value: string) => voidFired when the user selects a different item.
disabledbooleanDisables all radio items in the group.
namestringName attribute on the underlying form inputs.
requiredbooleanMarks the group as required for form submission.

RadioGroupItem

Extends React.ComponentProps<typeof RadioGroupPrimitive.Item>.

PropTypeNotes
valuestringThe value this item represents. Required.
disabledbooleanDisables this item only.