Pricing Table
ProNewPlans as a joined grid, photo cards, a comparison table or a single paged card, with a monthly and yearly toggle.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| plans* | PricingPlan[] | — |
| layout | "grid" | "columns" | "table" | "card"`grid` joins the plans into one bordered block with centered rows. `columns` gives each plan its own card with a photo and a checklist. `table` compares plans feature by feature. `card` shows one plan at a time with arrows and swipe. | "grid" |
| tone | "auto" | "dark"`dark` forces the dark palette whatever the page theme is. It relies on the `.dark` class tokens. | "auto" |
| accent | stringColor of ribbons, buttons and checks. Any CSS color that reads well under white text. | "#4353ff" |
| title | stringA heading above the plans. | — |
| billing | BillingControlled billing period. The toggle appears when any plan has monthly and yearly prices. | — |
| defaultBilling | BillingThe billing period selected at first. | "monthly" |
| onBillingChange | (billing: Billing) => voidCalled when the visitor switches the billing period. | — |
| yearlyBadge | stringA small bubble over the yearly option, such as "Save 15%". | — |
| currency | stringISO 4217 currency code for numeric prices. | "USD" |
| locale | stringBCP 47 locale for numeric prices. | "en-US" |
| cta | stringDefault button text. | "Choose plan" |
| onSelect | (plan: PricingPlan, billing: Billing) => voidCalled with the chosen plan and the billing period. | — |
| loading | booleanShows placeholders while plans are being fetched. | false |
| emptyText | stringShown when `plans` is empty. | "No plans to show yet." |
| className | string | — |
Accessibility
- The billing toggle is a native radio group, and the switch to new prices is announced in a live region.
- The comparison is a real table with column and row headers; checks and dashes carry Included and Not included text.
- Crossed-out prices are read as Was and Now, and every button names its plan.
- On narrow containers the grid and card scroll with snap, swipe and labelled arrow buttons; the table shows one plan chosen from a button group.
- Hints open on hover and on focus and close with Escape; price changes do not animate under reduced motion.