Plan comparison
Side-by-side plan tier matrix with a monthly and yearly billing toggle, rolling per-seat prices, a shared selected-plan rail, and a differences-only switch that collapses shared rows.
import { PlanComparison } from '@uthereal/ui/plan-comparison'Plan comparison playground
Room for the way you work
Compare plans
8 of 8 featuresTeam
For smaller teams
Studio
For work across teams
Overview
PlanComparison compares 2 to 4 pricing tiers in a single self-contained matrix. The header pairs the section heading with a monthly/yearly billing toggle and savings note; switching intervals rolls every per-seat price smoothly on an odometer without shifting column heights.
Below the header, a Differences only switch hides rows marked shared: true with a height spring while rolling the visible feature counter. Selecting a plan highlights its column and glides a shared bottom rail to the chosen header, announcing the choice in a polite live region.
Use PlanComparison when buyers need to weigh a small set of fixed plan tiers side by side. For interactive seat-count pricing with volume tiers, use Pricing calculator. For an us-versus-them matrix against competitors, use Comparison table.
Usage
'use client'
import { PlanComparison } from '@uthereal/ui/plan-comparison'
export function WorkspacePlans({
onChoose,
}: {
onChoose: (planId: string | null) => void
}) {
return (
<PlanComparison
defaultInterval="yearly"
selectAction="select_pricing_plan"
onSelectPlan={onChoose}
onIntervalChange={(interval) => {
console.log('Billing interval:', interval)
}}
onAction={(action, planId) => {
console.log(action, planId)
}}
/>
)
}Omit plans and features to render the built-in Team and Studio sample comparison with local billing, filter, and selection state (nothing leaves the browser).
Examples
Three-tier yearly EUR comparison
Configure 3 or 4 plans with defaultInterval="yearly", defaultPlanId, currency="€", and a BCP 47 locale to format localized per-seat prices and pre-highlight a recommended tier.
Choose a workspace plan
Annual billing locks in up to 22% savings across every seat.
Compare plans
7 of 7 featuresStarter
For small crews
Growth
For scaling product teams
Enterprise
For regulated orgs
Differences-only default
Set defaultDifferencesOnly to start with shared capabilities collapsed, customize featuresCountLabel, and attach selectAction so plan clicks report to your host action registry.
Workspace plans
Compare plans
6 differing of 8 featuresTeam
For smaller teams
Studio
For work across teams
Matrix cells and filtering
Cell value conventions
| Cell text | Rendering |
|---|---|
"Included" | Draws a success-colored check icon beside the word. |
"Not included" | Renders in muted text to recede visually. |
| Any other string | Renders as plain secondary text (for example "30 days", "Unlimited"). |
Shared vs differing rows
shared | values requirement | Behavior under Differences only |
|---|---|---|
false | Exactly one entry per plan, matching plans order. | Always visible. |
true | One value repeated across all plans (or identical entries). | Collapses out of view when enabled. |
API reference
These serializable arguments and defaults come directly from the component schema.
| Argument | Type / default | Description |
|---|---|---|
title | stringDefault: "Room for the way you work" | Heading and accessible section name. |
description | string— | Supporting line below the heading. Pass an empty string (or null in React) to hide it. |
plans | ComparisonPlan[]Default: [{"id":"team","name":"Team","description":"For smaller teams","monthlyPrice":13,"yearlyPrice":10},{"id":"studio","name":"Studio","description":"For work across teams","monthlyPrice":27,"yearlyPrice":22}] | The plan tiers compared side by side, 2 to 4 plans with unique ids, each with per-seat monthly and yearly prices. |
features | ComparisonFeature[]Default: [{"id":"active-projects","label":"Active projects","shared":true,"values":["Unlimited"]},{"id":"workspaces","label":"Shared workspaces","values":["1","Unlimited"],"shared":false},{"id":"guest-reviewers","label":"Guest reviewers","values":["5 per project","Unlimited"],"shared":false},{"id":"version-history","label":"Version history","values":["30 days","Unlimited"],"shared":false},{"id":"approval-flows","label":"Approval flows","values":["Not included","Included"],"shared":false},{"id":"custom-roles","label":"Custom roles","values":["Not included","Included"],"shared":false},{"id":"source-exports","label":"Source exports","shared":true,"values":["Included"]},{"id":"support","label":"Support","values":["Email","Priority email"],"shared":false}] | Feature rows compared across the plans, in order. Non-shared rows need one value per plan; shared rows carry one value repeated across every plan. |
defaultInterval | monthly | yearlyDefault: "monthly" | Initially selected billing interval. Edits do not reset a mounted instance. |
defaultPlanId | string— | Initially chosen plan id, matching one of the plans; omitted starts with none selected. |
defaultDifferencesOnly | booleanDefault: false | Initial differences-only filter state. Edits do not reset a mounted instance. |
currency | stringDefault: "$" | Currency symbol placed before each rolling price. |
pricePeriodLabel | stringDefault: "per seat / month" | Unit note after each rolling price. |
monthlyNote | stringDefault: "Billed month to month" | Savings note shown while the monthly interval is selected. |
yearlyNote | stringDefault: "Billed yearly, save up to 23%" | Savings note shown while the yearly interval is selected. |
featureColumnLabel | stringDefault: "What changes" | Column header over the feature names. |
compareLabel | stringDefault: "Compare plans" | Heading of the feature filter row. |
differencesLabel | stringDefault: "Differences only" | Label of the switch hiding rows where plans agree. |
featuresCountLabel | stringDefault: "{shown} of {total} features" | Rolling feature counter template; {shown} fills visible rows, {total} every row. |
billingLabel | stringDefault: "Billing period" | Accessible name of the monthly/yearly switch group. |
monthlyLabel | stringDefault: "Monthly" | Label of the monthly billing option. |
yearlyLabel | stringDefault: "Yearly" | Label of the yearly billing option. |
selectLabel | stringDefault: "Select {plan}" | Select button label template; {plan} fills the plan name. |
selectedLabel | stringDefault: "Selected" | Select button label while a plan is chosen. |
footerNote | stringDefault: "Prices in USD per seat. Yearly plans are billed annually." | Static note in the footer. |
selectedAnnouncement | stringDefault: "{plan} selected" | Polite status template announced when a plan is selected or cleared; {plan} fills the plan name. |
selectAction | string— | Registered host action requested when a plan is selected or cleared; reports the plan id. |
locale | string— | BCP 47 locale for price digit grouping; inherited when omitted. |
recipe | studio | softDefault: "studio" | Visual treatment. Both recipes preserve interaction behavior. |
theme | PlanComparisonThemeDefault: {} | Color mode, accent, and typed semantic token overrides. |
motion | none | subtle | expressiveDefault: "subtle" | Animation preset. System reduced-motion preferences take precedence. |
motionOptions | PlanComparisonMotionOptionsDefault: {} | Price roll, selected highlight, and row reflow timing overrides in milliseconds. |
dir | ltr | rtl— | Reading direction; inherited from the page when omitted. |
ComparisonPlanaccepts{ id, name, description?, monthlyPrice, yearlyPrice }. Plan IDs must be unique, andyearlyPricecannot exceedmonthlyPrice.ComparisonFeatureaccepts{ id, label, shared?, values }. Feature IDs must be unique, and every non-shared row must provide one string per plan.
React integration
| Prop | Purpose |
|---|---|
onSelectPlan(planId) | Called with the chosen plan ID, or null when the user clears their current selection. |
onIntervalChange(interval) | Called with 'monthly' or 'yearly' whenever the billing toggle changes. |
onAction(action, itemId?) | Called with selectAction and the clicked plan ID on every plan toggle. |
preset | Application defaults overridden by explicit instance arguments. |
tokens | CSS variables applied after the typed theme, forwarded to the root and composed child controls. |
ref, className, style | Applied to the root <section> element. |
| Native attributes | id, aria-*, data-*, and remaining <section> props forwarded to the root element. |
Keyboard & accessibility
| Key | Action |
|---|---|
Tab | Moves across the billing toggle, differences switch, and each plan select button. |
ArrowLeft / ArrowRight | Switches between Monthly and Yearly inside the billing toggle (RTL-aware). |
Enter / Space | Toggles Differences only or selects and clears a plan tier. |
- The matrix uses semantic
role="table",role="row",role="columnheader",role="rowheader", androle="cell"roles witharia-labelledbytied to the section heading. - Each rolling price region carries
aria-live="polite"andaria-atomic="true"with visually hidden plain text so screen readers announce the complete amount once rather than digit by digit. - Each select button exposes
aria-pressedfor the active plan, and a pre-mountedrole="status"live region announcesselectedAnnouncementwhen a plan is chosen or cleared. - Container queries tighten padding below
720pxand stack feature names above their aligned plan values below640px, revealing per-cell plan labels automatically. Logical CSS properties mirror cleanly in RTL (dir="rtl"), and@media (forced-colors: active)maps borders, rails, and check icons to system colors.
Motion & theming
Prices and the feature counter roll on an odometer, the selected-plan bottom rail glides between columns on a shared layoutId morph spring, and filtered rows expand and collapse height on the smooth spring (0.4s, zero overshoot).
Under prefers-reduced-motion: reduce, rolling digits jump immediately, rail glides disable, and row transitions fall back to 120ms opacity crossfades. Setting motion="none" makes every transition immediate (0ms).
theme accepts mode, accent, and typed tokens across these groups:
| Token group | CSS custom properties |
|---|---|
core | --ui-surface, --ui-surface-raised, --ui-text, --ui-text-secondary, --ui-muted, --ui-border, --ui-highlight, --ui-accent, --ui-accent-foreground, --ui-danger, --ui-focus-ring, --ui-radius, --ui-border-width, --ui-shadow, --ui-disabled-opacity, --ui-font, --ui-font-size, --ui-font-weight |
extended | --ui-surface-sunken, --ui-border-strong, --ui-border-subtle, --ui-track, --ui-info, --ui-success, --ui-warning, --ui-tone-foreground, --ui-overlay, --ui-tint-strength |
shape | --ui-radius-sm, --ui-popup-radius, --ui-surface-radius |
control | --ui-control-height, --ui-control-padding-x, --ui-control-gap, --ui-icon-size |
An application-wide UtherealProvider supplies defaults.
Composition
In an agent composition, PlanComparison is a leaf block. Provide 2 to 4 plans with unique IDs, align every non-shared feature row's values array with plans, and wire selectAction to a registered host action. See Building with agents.
{
"type": "PlanComparison",
"props": {
"title": "Workspace plans",
"defaultInterval": "yearly",
"defaultPlanId": "studio",
"selectAction": "select_pricing_plan"
},
"children": []
}