Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Checkout Plan Picker Billing Block for React

The plan picker inside a checkout: plan cards, a monthly or yearly period, a seat stepper, a promo code that validates itself and an order summary whose total rolls as you change anything.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Let customers pick and pay in one place, with this checkout plan picker for React with Base UI. A hairline frame with a plus mark on each corner holds two columns. The first is the order's inputs: three plan cards as a Radio Group, each with its blurb and its price per agent per month; a monthly or yearly Segment Group; a Number Input for the agents; and a promo code Field with an Input and an Apply button that checks the code and says why when it fails. The second is the order summary: each line of the bill, the due-today total rolling with Sliding Number, what the next invoice will be and when, and a Shine Button to start the plan, the only colored control. The chosen plan and the radio dot stay in your foreground color. On a phone the summary drops below the form and the total and the button ride a bar fixed to the foot of the panel. It's built from Radio Group, Segment Group, Number Input, Field, Input, Badge, Button, Shine Button, Sliding Number and Guides, with a CSS entrance only. For SaaS checkouts, plan upgrades and any per-seat product.

FAQ

How do I change the plans, periods and promo codes?

Everything is at the top of the file. PLANS lists each plan's name, blurb, price per agent per month billed monthly (monthly) and billed yearly (yearly), and an optional tag. PERIODS gives each period its months and the date it renews, and PROMOS maps a code to the percent it takes off. The "save 20%" and "Yearly billing, 20% off" wording is typed text, so update it if you change the yearly prices.

How does the promo code work?

Press Apply or Enter in the field. An empty field says "Enter a promo code" and an unknown code says it isn't valid or has expired, in an error tied to the field. A known code is applied: the field gives way to a line naming it and a Remove button, and the summary shows its discount. The lookup in PROMOS runs in the browser so the block works on its own; check codes on your server before you charge, and treat the discount here as a preview.

How is the total worked out?

The list price is the plan's monthly price times the agents times the months the period covers. The billed amount uses the yearly price on a yearly period, so the difference shows as the yearly discount, and a promo's percent comes off that. Due today is the result, and "Then" gives the same amount for the next invoice on the date its period renews. Tax isn't added: the summary says it's worked out at payment, from the billing address. Wire the amounts to your own pricing so the page and your charge agree.

Where does the call to action go?

"Start" is a real link. It's a ShineButton with render set to an a element and nativeButton={false}. Point it at your payment step and add the plan, the agents, the period and the applied code to its address so the next page charges what this one showed. There are two of the same link: the one in the summary and the one in the phone bar, and only one is visible at a time.

How does it work with a keyboard and a screen reader?

The plans are real radio buttons in a named group, so the arrow keys move between them, and the whole card is the label. The period is a named group of two options, the agents field has its own stepper buttons and takes typed numbers from 1 to 100, and the promo field's error is read with the field. Whenever the plan, the period, the agents or the code change, a polite status line says the plan, the agents and what's due today, so you hear the new total without leaving the control.

How does it look on a phone?

The cards, the period and the agents stack in one column, then the promo code and the summary. The summary's button is hidden at that size; the total and the same button sit on a bar that sticks to the bottom of the panel while you scroll, so you can pay from wherever you are in the form.

  • Pro

    Current Plan Billing

    Plan and usage

    The account's current plan in app settings: plan, price, renewal date and card, a change-plan action, every quota's usage this period on shared hairlines, and the next invoice.

  • Pro

    Billing Toggle Pricing

    Billing switches

    Three plan cards under a monthly and yearly switch that wears its saving in the header row, with prices that roll to their new amount and each plan a card in a card.

  • Pro

    Seat-type pricing with a stepper for each type: Full, Collaborator and Viewer seats at different prices, a stacked bar of the seat mix, a live monthly total and, on a phone, a sticky total bar.

  • Pro

    A seat calculator: a slider sets the team size with its count riding the thumb, ticks at the 10, 25 and 50 seat discounts, shortcuts to them, and a panel that rolls the seat price and monthly total.

  • Pro

    A needs checklist for picking a plan: tick what you need and the cheapest plan that covers every need lights up with its price, while each need says which plan it starts at.

  • Pro

    Invoice Preview Pricing

    Comparison tables

    Three payroll plans as itemised monthly invoices: pick a headcount and each plan's bill adds up line by line, with its total and call to action at the top of its column.