Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Pricing Table

ProNew

Plans as a joined grid, photo cards, a comparison table or a single paged card, with a monthly and yearly toggle.

Installation

pnpm dlx shadcn@latest add @viewport/pricing-table

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
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"
accentstring

Color of ribbons, buttons and checks. Any CSS color that reads well under white text.

"#4353ff"
titlestring

A heading above the plans.

—
billingBilling

Controlled billing period. The toggle appears when any plan has monthly and yearly prices.

—
defaultBillingBilling

The billing period selected at first.

"monthly"
onBillingChange(billing: Billing) => void

Called when the visitor switches the billing period.

—
yearlyBadgestring

A small bubble over the yearly option, such as "Save 15%".

—
currencystring

ISO 4217 currency code for numeric prices.

"USD"
localestring

BCP 47 locale for numeric prices.

"en-US"
ctastring

Default button text.

"Choose plan"
onSelect(plan: PricingPlan, billing: Billing) => void

Called with the chosen plan and the billing period.

—
loadingboolean

Shows placeholders while plans are being fetched.

false
emptyTextstring

Shown when `plans` is empty.

"No plans to show yet."
classNamestring—

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.