Shadcn.io is not affiliated with official shadcn/ui
Shadcn Radio Group
React radio group for checkout, surveys, and settings. Built with TypeScript and Tailwind CSS for Next.js using Base UI — one option selected, arrow keys move.
A radio group is one answer from a short list. Click a row and the others clear. Use it for shipping speed, a plan, or a survey — anything where picking two would be a bug.
Looking for a neobrutalism version for shadcn?
Same radio group, thicker borders. The NeoBrutalism radio group is the kit if you want that look.
Usage
import { Label } from "@/components/ui/label"
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"<RadioGroup defaultValue="option-one">
<div className="flex items-center gap-3">
<RadioGroupItem value="option-one" id="option-one" />
<Label htmlFor="option-one">Option One</Label>
</div>
<div className="flex items-center gap-3">
<RadioGroupItem value="option-two" id="option-two" />
<Label htmlFor="option-two">Option Two</Label>
</div>
</RadioGroup>defaultValue is the one that starts checked. Own the state with value and onValueChange.
Composition
Pair each item with a Label or Field. The indicator lives inside RadioGroupItem.
Description
FieldContent plus FieldDescription for the helper line under the label.
Choice Card
Wrap the Field in FieldLabel so the whole card is the click target.
Fieldset
FieldSet plus FieldLegend name the group. That's the markup a screen reader expects.
Disabled
disabled on RadioGroupItem, data-disabled on the Field so the label greys out with it.
Invalid
aria-invalid on the item. data-invalid on the Field. Both, or the label stays the wrong color.
RTL
Wrap with DirectionProvider and dir="rtl". Labels stay Arabic.
API
Prop
Type
RadioGroupItem
Prop
Type
Keyboard
| Key | Action |
|---|---|
Tab | Focus the checked item, or the first if none |
Space | Check the focused item if it isn't already |
ArrowDown / ArrowRight | Move to the next item and check it |
ArrowUp / ArrowLeft | Move to the previous item and check it |
Notes
Arrows select, they don't just move
ArrowDown checks the next item. There is no focused-but-unchecked state. Don't put a dummy first value if you don't want it posted.
orientation is for the arrow keys. Layout is still grid gap-3 — stack or row it yourself.
With other components
Label and helper text
LabelClick the words
FormSubmit the selection
CardPlan as a card
ButtonSubmit the form
ItemRow in a list
Questions
Related
Was this page helpful?
Sign in to leave feedback.
Questionnaire
React questionnaire for onboarding, intake, and research flows. Built with TypeScript and Tailwind CSS for Next.js using Base UI — choices, freeform, skip, and progress.
Resizable
React resizable for dashboards and split editors. Built with TypeScript and Tailwind CSS for Next.js using Base UI — drag handles, nested groups, and RTL.