Skip to main content
PlanCard renders a single plan with its price, the lines read from the plan and a button, for when you lay out your pricing page yourself instead of using PricingTable. When to use
  • A custom pricing grid, carousel or comparison page.
  • A “recommended plan” box next to other content.
  • An upgrade prompt that shows the plan the customer would move to.
PlanCard for the Pro plan with its price, three lines and a Get Started button, light theme

Importing PlanCard

Rendering PlanCard

Pass a plan and an onSelect handler; the card calls it with the plan code and return URL when the “Get Started” button is clicked:
components/pro-card.tsx
The card shows the name, description, price with its interval and the plan’s lines from planFeatures. The price is formatted in the plan’s currency, without decimals for whole amounts ($29, $14.99). The interval reads month, year, week, quarter or 6 months; other intervals show as sent. PlanCard does not fetch anything and does not show Powered by Nozle.

Data

The card needs one plan in the PricingPlan shape the public catalog returns:

Live data

Read the plans with usePlans inside BillingProvider, and start checkout with useCheckoutSession, which calls the provider’s createCheckout:

Examples

Current plan

With isCurrent, the card gets a primary-colour border, aria-current="true" and a disabled “Current Plan” button.
PlanCard for the current Free plan with a disabled Current Plan button, light theme

Panel layout

The themes nozle and nozleDark use the panel card layout: the name in a header band, with a badge that reads “Active” on the current plan.
PlanCard for the Pro plan in the panel layout with a header band, nozle theme

Custom lines

features replaces the lines read from the plan.

API reference

PricingPlan
required
The plan to show: code, name, amount_cents, amount_currency, interval, and optional description, entitlements, credit_grant_rules, charges.
boolean
required
Shows the card as the customer’s plan: a primary-colour border, aria-current="true", and a disabled “Current Plan” button.
string[]
Replaces the lines read from the plan. Defaults to the lines from planFeatures(plan).
(input: CreateCheckoutInput) => void
Fires when the “Get Started” button is clicked and receives { planCode, returnUrl }. Without it the card has no button.
string
The returnUrl passed to onSelect. Defaults to the current URL.
Appearance
Theme, variables and element overrides. Defaults to the provider’s. See Appearance.

States

The root has data-testid="plan-card-<code>".

Appearance

planCard (root), planCard__name, planCard__description, planCard__price, planCard__features, planCard__feature, planCard__cta. In the panel layout also planCard__header and planCard__badge, which reads “Active” on the current plan.Style them with appearance.elements. See Elements.

PricingTable

All plans with checkout built in.

PlanComparison

The plans side by side, feature by feature.

CheckoutButton

A button that starts checkout for one plan.

PlanBadge

The plan name as a small badge.