Prodular UI

Radio group

Pick exactly one option from a small set that people should see side by side, as a list or as choice cards.

npx prodular-ui add radio-group

List

Send alert emails

Choice cards

Wrap a Field in FieldLabel to make the whole card clickable.

Plan

Anatomy

<RadioGroup defaultValue="hourly">  <Field orientation="horizontal">    <RadioGroupItem value="hourly" />    <FieldLabel>Hourly digest</FieldLabel>  </Field></RadioGroup>

Guidance

Use it when

  • Two to five options people should compare before choosing: plans, frequencies, visibility.

Avoid

  • More than six options. Use Select.
  • A single yes or no. Use Checkbox or Switch.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Always set defaultValue or value. A radio group with nothing selected is hard to undo.
  • Wrap each RadioGroupItem and its FieldLabel in Field orientation="horizontal". Field links them, so ids are optional.
  • Label the group with FieldSet and FieldLegend variant="label".
  • For choice cards, put Field orientation="horizontal" inside FieldLabel, with FieldContent first and the item last.

API

RadioGroup

PropTypeDefaultDescription
value / defaultValueunknownControlled or initial selection.
onValueChange(value) => voidCalled when the selection changes.

RadioGroupItem

PropTypeDefaultDescription
valueunknownThe value this item selects.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add radio-group# or, with the registry in components.jsonnpx shadcn@latest add @prodular/radio-group