RadioGroup
Pick exactly one option from a small, mutually exclusive set. Built on base-ui Radio — roving focus, arrow-key navigation, and the hidden form input come for free.
Compose two parts: RadioGroup (the root, owns the selected value) and one RadioGroupItem per choice. Pair each item with a Label whose htmlFor matches the item’s id so the whole row is clickable.
Default
Give the root a defaultValue to render uncontrolled — base-ui tracks the selection internally. Wrap each RadioGroupItem in a Label for a click target.
Controlled
To drive the selection yourself (e.g. to feed it into a label-print request), pass value and onValueChange. The ui-next wrapper hands onValueChange the selected value directly as a string.
Selected format: pdf-4x6
Disabled
Set disabled on a single RadioGroupItem to take one choice out of play, or on the RadioGroup root to disable every item at once.
Disabled item
Disabled group
Horizontal layout
The root defaults to a vertical grid with gap-3. There is no orientation prop — lay items out in a row by overriding the wrapper with flex utilities via className.
Reference
RadioGroup
Root container. Wraps base-ui RadioGroup and applies grid w-full gap-3 to the wrapper.
| Prop | Type | Default | Description |
|---|---|---|---|
defaultValue | unknown | — | Initially selected value (uncontrolled) |
value | unknown | — | Selected value (controlled) |
onValueChange | (value: string) => void | — | Fires with the newly selected value |
name | string | — | Identifies the field when submitted in a form |
disabled | boolean | false | Disables every item in the group |
readOnly | boolean | false | Prevents changing the selection while keeping it focusable |
required | boolean | false | Requires a choice before form submission |
className | string | — | Merged onto the wrapper; override grid/gap for custom layout |
RadioGroupItem
One radio button. Extends base-ui Radio.Root props.
| Prop | Type | Default | Description |
|---|---|---|---|
value | any | — | The value this item selects in the group |
id | string | — | Ties the item to a Label via htmlFor for a click target |
disabled | boolean | false | Disables just this item |
className | string | — | Merged onto the radio control |