Pricing plans
Shown as Tally, a made-up product
Pricing for an uptime and on-call product: three plans as columns of one table, prices that roll between monthly and yearly, a lane that glides to the plan you choose and a checkout bar that totals it.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/tally-plans.json?token=…"Adds the piece to components/propui/06-tally-plans/ and installs motion. Needs a free account: sign in and the command includes your token. Fonts load from Prop UI; download the zip to self-host them.
When to use
Reach for it when
- A pricing page with two to four plans that differ by limits, not by a long list of extras.
- Letting a buyer compare plans feature by feature and see the total before checkout.
- Pricing with a monthly and a yearly period, where the yearly discount should be visible on every figure.
Something else fits when
- One plan, or plans with nothing to compare: three simple cards are lighter.
- Usage-based pricing that needs a calculator: build the estimator around the inputs instead.
- More than about 20 feature rows: group them into sections or link to a full comparison page.
Usage
A section in normal page flow.
import Piece from "@/components/propui/06-tally-plans/Section";
export default function Page() {
return <Piece />;
}Replace PLANS, FEATURES, FREE_MONTHS, RECOMMENDED and RENEWS in data.ts, and wire the Continue button in Section.tsx to your checkout. Every price, saving, count and the checkout line are computed from those values.
Your data
Replace these and everything on screen follows.
PLANS{ id; name; line; monthly }[]- The columns: name, one-line description and the monthly price everything else is worked out from.
FEATURES{ label; hint?; values: Record<PlanId, string> }[]- The rows; "yes" draws a tick, "no" a dash, anything else prints as text.
FREE_MONTHSnumber- The yearly discount: yearly = 12 × monthly − FREE_MONTHS × monthly, and the "2 months free" label.
RECOMMENDEDPlanId- The plan with the Recommended tag, chosen when the page loads.
RENEWSRecord<Billing, string>- The renewal date in the checkout bar for each billing period.
PlanId"solo" | "team" | "scale"- The plan ids; change them with PLANS and the values keys in FEATURES.
Interactions
- Switch between Monthly and Yearly: every price rolls to its new value and the billed line under each price cross-fades.
- Choose a plan: the raised lane slides to its column and the checkout bar changes to that plan's total and renewal date.
- Turn on Only what differs to fold away the rows every plan shares; the feature count rolls with it.
- On a narrow screen, pick Solo, Team or Scale above the table to see that plan's values.
Keyboard
- ←or→or↑or↓
- In the billing period or plan picker, move the choice and the focus.
- HomeorEnd
- In the billing period or plan picker, jump to the first or last option.
- EnterorSpace
- Choose the focused plan, or flip the Only what differs switch.
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- The comparison is marked up as a table: plan headers are column headers and feature names are row headers.
- Ticks and dashes carry hidden text (Included, Not included), so the meaning never rests on an icon.
- Segmented controls are groups of buttons with aria-pressed; only the chosen option is a tab stop.
- Only what differs is a button with role switch and aria-checked.
- A polite live region announces the chosen plan, its price and billing period.
- Prices read as one phrase ("$45 a month") through hidden text, while the rolling digits are hidden from screen readers.
Motion
- The lane, the segmented pills, the switch thumb and moving rows share one spring set by visual duration, so short and long moves feel the same.
- Prices and the feature count roll on a spring; labels that swap (Choose and Chosen, the billed lines) cross-fade in one grid cell, so nothing changes size.
- Filtering rows fades the leaving rows out, slides the rest into place on transforms and eases one wrapper's height.
- The checkout bar slides up once after load; after that only its text changes.
- Reduced motion makes every change instant.
Responsive
- The table follows its own width (container queries), not the window.
- Under 760px of table width the cell padding tightens and the price shrinks.
- Under 600px of table width it shows one plan at a time with a Solo / Team / Scale picker; rows read feature | value and the hints hide.
- Under 720px of window the nav links hide, the intro stacks, and the checkout bar drops "with Team" and the saving to fit one row.
Performance
- The lane moves only by transform on its own layer, so sliding between plans repaints nothing.
- The checkout bar uses a near-opaque fill rather than a backdrop blur, so the sticky bar costs nothing while scrolling.
- Row height changes animate on one wrapper measured by a ResizeObserver, not on each row.
- No images or canvas: inline SVG and two local font files.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- Keep every price derived from PLANS and FREE_MONTHS through priceOf(); never type a yearly figure by hand.
- Keep labels that swap in one stacked grid cell (tp-stack) so buttons and lines never change width.
- Every class is prefixed tp- and scoped under .tp; keep colours in the tokens at the top of post.css.
/p/tally-plans/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.