Vesyl UI

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.

PropTypeDefaultDescription
defaultValueunknownInitially selected value (uncontrolled)
valueunknownSelected value (controlled)
onValueChange(value: string) => voidFires with the newly selected value
namestringIdentifies the field when submitted in a form
disabledbooleanfalseDisables every item in the group
readOnlybooleanfalsePrevents changing the selection while keeping it focusable
requiredbooleanfalseRequires a choice before form submission
classNamestringMerged onto the wrapper; override grid/gap for custom layout

RadioGroupItem

One radio button. Extends base-ui Radio.Root props.

PropTypeDefaultDescription
valueanyThe value this item selects in the group
idstringTies the item to a Label via htmlFor for a click target
disabledbooleanfalseDisables just this item
classNamestringMerged onto the radio control