Plan Picker
betaPlan cards in a radio group whose selection outline and corner dot travel along the cards' edges to the new choice.
- Forms
- 1 file
- 2 npm packages
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add plan-pickernpm packages installed: class-variance-authority, radix-ui.
import { PlanPicker } from "@/components/ui/plan-picker";Default
Demo Story
Custom Plans
<PlanPicker>
| Prop | Type | Default |
|---|---|---|
defaultValueThe plan chosen at first (uncontrolled). Defaults to the first plan. | string | — |
onValueChangeCalled with the plan's value when the choice changes. | (value: string) => void | — |
plansThe plans, in order. Defaults to Basic, Pro and Team. | Plan[] | DEFAULT_PLANS |
size | "sm" | "md" | "lg" | "md" |
valueThe chosen plan's value (controlled). | string | — |
Every prop of Radix UI’s RadioGroup.Root, plus className.
Built on the Radix radio group: a radiogroup (named "Plan" by default; override with aria-label) of radio buttons, one tab stop, arrow keys move and choose, and a hidden input carries the value inside forms. Each card's accessible name is its plan and price text. The travelling outline and dot are aria-hidden; the checked state is what is announced, and the checked card's name also brightens so the choice is not shown by the outline alone. Layout and travel mirror in right-to-left layouts, and under reduced motion the outline jumps.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes