Avara UI

Radio Button

An accessible, animated radio button group (RadioButtonGroup) with card-style options, keyboard arrow navigation, and optional press ripple feedback.

About Radio Button

What it is. RadioButtonGroup is a card-based radio selector supporting vertical stacks, multi-column grids, leading icons, inverted subscription cards, custom check indicators, and tactile press ripples.

How it is built. Implements accessible role="radiogroup" / role="radio" semantics with full arrow-key navigation, controlled or uncontrolled value management, and theme-synced active borders.

When to use it. Use RadioButtonGroup when users choose one option from rich cards (plans, shipping methods, payment options, deploy regions). For compact inline toggle buttons, use Toggle Group.

For AI agents

Hand your agent this brief or the Markdown page, not a screenshot.

When to use

  • Single-choice card selectors for pricing plans, delivery/payment options, or deploy regions
  • Rich option items with label, description, meta pricing, icons, or press ripple feedback

When not to use

  • Compact toolbar/segmented switches — use Toggle Group
  • Long lists of options in a dropdown — use Select

Agent notes

  • Named export: import { RadioButtonGroup } from "@/components/custom/blocks/RadioButtonBlock"
  • options is required and each value must be unique. The group is controlled when value is not undefined; otherwise pass defaultValue (it falls back to the first enabled option).
  • Pass label or ariaLabel so the radiogroup has an accessible name; with neither it is named "Options".
  • delivery-and-payment and controlled are demo names with no styling of their own; they render like default.
  • Needs the lucide-react package, which the registry install adds. It uses no animation library.
For AI agents11 variants. Ask the user which one.

Ask before you pick. This page has 11 variants. If the user has not named one and has not asked you to choose for them, ask which they want before you install anything or write code, and show every option with its live link. If they ask you to choose, pick from each variant's best-for and avoid-if lines against their brief, and say why. If the user named a variant, use it and do not ask.

All 11 options as live previews: https://avaraui.com/view/radio-button

When to use it. Accessible card-style radio button groups with eleven examples across vertical plan cards, inverted subscription cards, checkout grids, icon cards, and ripple feedback.

Gotchas

  • Every look is one `radio-button` item — pass `variant` to switch layout and indicator style.
  • Press ripples are off by default and enabled only on `subscription-plans` and `with-ripple` (or via `ripple={true}`).

The 11 variants

  1. Select a Plan default

    Vertical card stack with top-right radio dot indicator and pricing.

    • Best for: pricing tier selection and vertical option lists
    • Avoid if: you want a compact horizontal 3-column grid
    • Traits: vertical stack, radio dot, pricing meta
    • Install: npx shadcn@latest add @avara-ui/radio-button
    • Docs section
  2. Subscription Plans subscription-plans

    Inverted high-contrast selected card with badge, centered check, and ripple.

    • Best for: billing cycle or featured subscription toggles
    • Avoid if: you want subtle border selection instead of inverted fill
    • Traits: inverted fill, discount badge, centered check, ripple
    • Install: npx shadcn@latest add @avara-ui/radio-button
    • Docs section
  3. Icon Cards icon-cards

    Wide plan cards with leading icon boxes, badges, pricing, and checkmarks.

    • Best for: workspace plan pickers with icons and badges
    • Avoid if: you only have short 1-line labels
    • Traits: icon boxes, badges, check indicator
    • Install: npx shadcn@latest add @avara-ui/radio-button
    • Docs section
  4. No Indicator no-indicator

    Vertical plan cards with border and ring selection and no radio indicator.

    • Best for: minimal card selection without radio dots
    • Avoid if: users expect an explicit radio circle
    • Traits: no indicator, border ring, clean cards
    • Install: npx shadcn@latest add @avara-ui/radio-button
    • Docs section
  5. Controlled controlled

    Controlled radio group with live selected value readout below the cards.

    • Best for: controlled form state with external readout
    • Avoid if: uncontrolled defaultValue is enough
    • Traits: controlled state, live readout, radio dot
    • Install: npx shadcn@latest add @avara-ui/radio-button
    • Docs section
  6. Disabled Group disabled-group

    Disabled radio group when option changes are temporarily unavailable.

    • Best for: locked or read-only plan states
    • Avoid if: options should be interactive
    • Traits: disabled state, muted opacity, radio dot
    • Install: npx shadcn@latest add @avara-ui/radio-button
    • Docs section
  7. Delivery And Payment delivery-and-payment

    Combined checkout layout pairing a 3-column delivery grid and 2-column payment icons.

    • Best for: multi-step checkout and shipping + payment forms
    • Avoid if: you only need a single radio group
    • Traits: checkout, delivery grid, payment icons
    • Install: npx shadcn@latest add @avara-ui/radio-button
    • Docs section
  8. Grid Layout grid

    Three-column responsive grid for compact delivery or shipping options.

    • Best for: shipping speeds or compact 3-column choices
    • Avoid if: options have long multi-line descriptions
    • Traits: 3-column grid, radio dot, compact cards
    • Install: npx shadcn@latest add @avara-ui/radio-button
    • Docs section
  9. With Icons with-icons

    Two-column horizontal icon cards with border/ring selection and no indicator.

    • Best for: payment methods and compact icon-led choices
    • Avoid if: you need an explicit radio dot or checkmark
    • Traits: 2-column grid, leading icons, no indicator
    • Install: npx shadcn@latest add @avara-ui/radio-button
    • Docs section
  10. Custom Indicator custom-indicator

    Three-column grid with an animated spring check-circle indicator.

    • Best for: audience or category grids with checkmark feedback
    • Avoid if: you prefer a minimal radio dot
    • Traits: 3-column grid, animated check, audience stats
    • Install: npx shadcn@latest add @avara-ui/radio-button
    • Docs section
  11. With Ripple with-ripple

    Three-column deploy region grid with press ripple feedback on click.

    • Best for: region pickers or tactile ripple selection
    • Avoid if: you want zero click ripple
    • Traits: 3-column grid, press ripple, region selector
    • Install: npx shadcn@latest add @avara-ui/radio-button
    • Docs section
Install
npx shadcn@latest add https://avaraui.com/r/radio-button.json
Registry name
@avara-ui/radio-button, through the shadcn MCP server
Index
llms.txt lists every page, or add the agent skill once

Props Reference

PropTypeDefaultDescription
variant"default" | "delivery-and-payment" | "subscription-plans" | "controlled" | "custom-indicator" | "disabled-group" | "grid" | "icon-cards" | "no-indicator" | "with-icons" | "with-ripple""default"Visual layout and indicator style of the radio button group.
optionsRadioButtonOption[]—Array of options (value, label, description, meta, badge, icon, disabled).
labelstringundefinedHeading displayed above the radio group.
descriptionstringundefinedHelper text displayed beneath the label.
valuestringundefinedControlled selected option value.
defaultValuestringFirst enabled optionInitial selected value for uncontrolled usage.
onValueChange(value: string) => voidundefinedCallback fired when the selected option changes.
disabledbooleanfalseDisables all options in the group.
ripplebooleantrue for subscription-plans & with-rippleEnables press ripple feedback on pointer click.
indicator"dot" | "check" | "none"Variant defaultOverrides the selection indicator style.
classNamestringundefinedAdditional CSS classes for the outer wrapper.

Works with other components

Does RadioButtonGroup support keyboard navigation?

Yes. The arrow keys (Up, Down, Left, Right) move focus and selection to the next enabled option, wrap at the ends and skip options marked disabled. Only the selected card is in the tab order, so Tab enters and leaves the group in one stop.

How do I make RadioButtonGroup controlled?

Pass value together with onValueChange. The group counts as controlled whenever value is not undefined, and onValueChange receives the option's value string on every click or arrow-key move. Without value, it keeps its own state starting from defaultValue.

How do I change the selection indicator on RadioButtonGroup?

Set indicator to "dot", "check" or "none". Without it the variant decides: with-icons and no-indicator show none, subscription-plans, custom-indicator and icon-cards show a check, and every other variant shows a dot in the top-right corner.

How do I turn the press ripple on or off in RadioButtonGroup?

Pass ripple={true} or ripple={false}. It defaults to on only for subscription-plans and with-ripple. The ripple starts from the pointer position on a real click, so keyboard selection never triggers it, and it is skipped when the user prefers reduced motion.

Can I disable a single option in RadioButtonGroup?

Yes. Set disabled: true on that entry in options and only it is dimmed, marked aria-disabled and skipped by arrow-key navigation. The group-level disabled prop does the same for every option at once and sets aria-disabled on the radiogroup.

Does RadioButtonGroup work in Vite or only Next.js?

It works in both. The file imports nothing from next/*, only React, lucide-react and the cn helper. The "use client" line at the top is ignored outside Next.js, and the install adds the lucide-react npm package.