Skip to main content
The React SDK separates public catalog and checkout orchestration from customer state:
  • PricingTable may load the public catalog with a publishable key.
  • Checkout components call your BillingProvider.createCheckout callback.
  • Gates, usage widgets, badges, and payment-method UI consume caller-supplied state.

Pricing components

React SDK pricing table

PricingTable

Renders responsive plan cards, an optional monthly/annual toggle, current-plan state, highlighted plans, and checkout actions.
When plans is omitted, PricingTable reads GET /api/v1/plans through BillingProvider. Supplying plans makes the component fully caller-driven and allows it to render outside a provider when onSelect is also supplied. PricingPlan contains code, name, amount_cents, amount_currency, interval, and optional description.

PlanCard

Use PlanCard when you already have a custom pricing layout and want an individual card.
Prices are expressed in major currency units for this presentational component, not cents.

PlanComparison

Renders a side-by-side feature table. Each feature maps plan IDs to a string or boolean.

Checkout components

CheckoutButton

Starts checkout through BillingProvider.createCheckout and handles hosted Stripe, embedded Stripe, Razorpay, completed, and scheduled results.

Checkout

Renders Stripe Payment Element checkout for a client secret returned by your merchant backend.
The useCheckout export from this component must be called inside the component’s Stripe Elements context. It returns confirmPayment, isProcessing, and error. Do not confuse it with useCheckoutSession, which creates checkout through your merchant callback.
Stripe webhook processing is authoritative. onSuccess, onComplete, and return-page navigation are user-interface signals, not proof that a subscription is active.

Plan-change components

React SDK billing components

UpgradeButton

Opens UpgradeModal and starts a plan change through the provider callback.
The component also accepts returnUrl, className, style, onCheckoutStarted, and onError.

UpgradeModal

Use the modal directly when your application owns its open state.
preview is caller-supplied and contains credit, debit, net, and nextBillingDate. The modal does not request a customer preview from the browser.

Billing display components

PlanBadge

tier controls presentation and accepts free, starter, pro, or enterprise.

PaymentMethodDisplay

Without onUpdatePaymentMethod, the update button navigates to updateHref, which defaults to /billing/update-payment. Omit paymentMethod to show the empty state.

Usage components

React SDK usage components

UsageMeter

The fill uses the primary color below 80%, warning from 80–94%, and destructive at 95% or above. getUsageMeterColor(percentage) exposes the same threshold selection.

UsageDashboard

Pass loading to render three skeleton rows. features defaults to an empty array.

UsageAlert

The component renders one dismissible warning for each feature at or above threshold. The default threshold is 80 and the default upgrade link is /plans.

Access-control components

FeatureGate, UsageGate, PlanGate, UpgradePrompt, and LockedOverlay are documented on Feature gates.