Ballmac UI home

Plan Selector

Pricing plan cards that work as a radio group, with a Monthly/Yearly switch that re-prices every plan, a highlighted plan, feature lists and form submission.

Choose a plan

Installation

$ pnpm dlx shadcn@latest add @ballmac/plan-selector

Usage

import { PlanSelector } from "@/components/ballmac/plan-selector"

The full example is in the Code tab above.

Examples

Controlled, one unavailable

Plan

Selected: Plus. Enterprise is unavailable in this demo.

API reference

PropTypeDefault
plans*

Plans to offer.

PlanOption[]—
value

Controlled selected plan id.

string—
defaultValue

Initial plan id when uncontrolled.

string—
onValueChange

Called with the plan id when one is chosen.

(id: string) => void—
billing

Controlled billing period.

Billing—
defaultBilling

Initial billing period.

Billing"yearly"
onBillingChange

Called when the billing period changes.

(billing: Billing) => void—
name

Name of the radio group, so the value submits with a native form.

string—
currency

ISO 4217 currency code.

string"USD"
locale

Locale for money. Fixed by default so server and browser match.

string—
legend

Visible legend for the group.

string"Choose a plan"

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Arrow keys / SpaceNative radio behavior between plans and the billing switch
Screen readersAnnounced as a radio group with position, name and price
Reduced motionPrice changes swap instantly

Use with AI

plans: {id,name,price:{monthly,yearly},features,highlight,disabled}. value/onValueChange pick a plan; billing/onBillingChange switch period; name submits with a form. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Plan Selector (@ballmac/plan-selector) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Upgrade and signup flows
  • Pricing sections where visitors choose a plan

Not for

  • A feature comparison grid; use comparison-table
  • Displaying the current plan; use billing-card

Registry JSON: https://ui.ballmac.com/r/plan-selector.json

Credits

Free to use in personal and commercial projects.