Powerful and customizable React radio group components built for modern applications and websites. These radio groups are built using React Aria and styled with Tailwind CSS.
Installation
You can add this radio groups component using our CLI or manually:
npx untitledui@latest add radio-groups
API reference
RadioGroupAvatar
Import RadioGroupAvatar from @/components/base/radio-groups/radio-group-avatar. Renders React Aria’s RadioGroup — all of its props are supported.
Props from React Aria (26)
Also accepts the global HTML attributes (dir, lang, hidden, inert, translate), all standard React DOM event handlers.
RadioGroupCheckbox
Import RadioGroupCheckbox from @/components/base/radio-groups/radio-group-checkbox. Renders React Aria’s RadioGroup — all of its props are supported.
Props from React Aria (26)
Also accepts the global HTML attributes (dir, lang, hidden, inert, translate), all standard React DOM event handlers.
RadioGroupIconCard
Import RadioGroupIconCard from @/components/base/radio-groups/radio-group-icon-card. Renders React Aria’s RadioGroup — all of its props are supported.
Props from React Aria (26)
Also accepts the global HTML attributes (dir, lang, hidden, inert, translate), all standard React DOM event handlers.
RadioGroupIconSimple
Import RadioGroupIconSimple from @/components/base/radio-groups/radio-group-icon-simple. Renders React Aria’s RadioGroup — all of its props are supported.
Props from React Aria (26)
Also accepts the global HTML attributes (dir, lang, hidden, inert, translate), all standard React DOM event handlers.
RadioGroupPaymentIcon
Import RadioGroupPaymentIcon from @/components/base/radio-groups/radio-group-payment-icon. Renders React Aria’s RadioGroup — all of its props are supported.
Props from React Aria (26)
Also accepts the global HTML attributes (dir, lang, hidden, inert, translate), all standard React DOM event handlers.
FAQs
Please refer to our frequently asked questions page for more.
No, radio groups are a PRO component. You need Untitled UI PRO access to install them with npx untitledui@latest add radio-groups. For basic radio inputs, the free radio buttons component is available.
There are six components, each in its own file: RadioGroupIconSimple, RadioGroupIconCard, RadioGroupAvatar, RadioGroupPaymentIcon, RadioGroupRadioButton and RadioGroupCheckbox. All six allow only one selection. RadioGroupCheckbox uses a checkbox-style indicator, but it still behaves as a radio group.
Pass an items array. Most variants expect value, title, secondaryTitle, description and icon on each item. RadioGroupAvatar uses id, name, username, title and avatarUrl. RadioGroupPaymentIcon uses value, title, description and a logo node. Set disabled: true on an item to disable it.
Each variant accepts React Aria's RadioGroup props. Use defaultValue for uncontrolled state, or value with onChange for controlled state. The value is the item's value, or its id for RadioGroupAvatar.
Every variant supports "sm" and "md" through the size prop. The default is "sm". "md" uses larger text, indicators and icons.
The components don't render a visible group label, so pass aria-label as the examples do, or aria-labelledby pointing to your own heading. Keyboard support comes from React Aria: Tab moves focus into the group and the arrow keys change the selection.
By default, options stack vertically using flex flex-col gap-3. Pass layout classes through className, such as flex-row or a grid. They're merged with tailwind-merge, so they replace the default classes that conflict.