Billing Checkout Stepper
A stepper for multi-step checkout and onboarding flows. Numbered circles connect with a line that fills in as steps complete, the current step is marked with aria-current, and Back/Continue buttons move between steps. The last step shows a completion panel instead of a Continue button. Step content itself is a placeholder, meant to be replaced with your own form for each step.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-checkout-stepper.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing32.tsx instead.
Usage
The file also exports billing32Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Billing32, billing32Demo } from "@/components/blocks/billing/billing32"; export default function Page() { return <Billing32 {...billing32Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| steps | CheckoutStep[] | none | Steps rendered left to right in order. Each step's label shows under its circle on sm screens and up. |
| defaultStepIndex | number | 0 | Which step is active on first render, clamped to a valid index. |
| backLabel | string | "Back" | Label for the back button. |
| nextLabel | string | "Continue" | Label for the forward button on every step except the last. |
| finishLabel | string | "Complete order" | Label for the forward button on the last step. |
| completeHeading | string | "You're all set" | Heading shown in the completion panel after the last step. |
| completeMessage | string | none | Supporting text shown under the completion heading. |
| className | string | none | Extra classes for the outer wrapper. |
Types
interface CheckoutStep { id: string; label: string; description?: string; }
Behavior notes
- The current step index is local component state, initialized from defaultStepIndex; there's no controlled mode where a parent drives the current step directly.
- Completed steps show a check icon in a filled circle and a solid connecting line; the current step gets a ring in the primary color and aria-current="step"; upcoming steps stay muted.
- Step labels are hidden below the sm breakpoint, so narrow viewports show only the numbered circles and connecting lines.
- The area below the stepper renders a dashed placeholder box, not real form fields, since this block is the progress indicator, not the per-step forms themselves.
- Clicking Continue on the last step swaps the whole panel for a completion message with a check icon; there's no way to navigate past it besides re-rendering the component.
- The Back button is disabled on the first step so it's never possible to go to a negative index.
Frequently asked questions
More Billing Blocks
View all →Billing Invoice List
Invoice history table with status badges, formatted amounts, and a per-row download link, built with shadcn/ui and Tailwind CSS.
Billing Failed Payment Alert
High-contrast failed-payment alert with a message, a retry button, and an optional update-payment-method button, built with shadcn/ui and Tailwind CSS.
Billing Credit Balance
Compact credit balance card with a large total, an optional purchased-versus-promotional breakdown, a low-balance notice, and a top-up button.
Billing Payment Methods
A saved payment method list for React and Next.js with brand icons, a default badge, near-expiry warnings, and remove/set-default actions per row.
Billing Add Card
A card entry form for React and Next.js with auto-formatted fields, internal brand detection, and per-field validation feedback built with shadcn/ui and Tailwind CSS.
Billing Coupon Code
An inline promo code input for React and Next.js with a simulated loading state, an applied summary showing the discount amount, and an invalid-code message.