Introduction

Learn how Stepperize helps you build typed multi-step flows.

Stepperize

Define your steps once. Use the generated hook, provider, or primitives anywhere in your React UI.

Stepperize is for flows where the user moves through named steps: checkout, onboarding, account setup, surveys, import wizards, approval flows, and multi-step forms.

import { defineStepper } from "@stepperize/react";

const checkout = defineStepper([
  { id: "shipping", title: "Shipping" },
  { id: "payment", title: "Payment" },
  { id: "review", title: "Review" },
]);

function Checkout() {
  const stepper = checkout.useStepper();

  return (
    <section>
      <h2>{stepper.current.title}</h2>

      {stepper.match({
        shipping: () => <Shipping />,
        payment: () => <Payment />,
        review: () => <Review />,
      })}

      <button type="button" disabled={!stepper.canPrev} onClick={() => stepper.prev()}>
        Back
      </button>
      <button type="button" disabled={!stepper.canNext} onClick={() => stepper.next()}>
        Next
      </button>
    </section>
  );
}

That is the whole idea: one typed definition drives everything — the hook, the provider, the primitives, and exhaustive rendering, all sharing the same step ids.

Get started

How it grows with you

You can stop at the first layer that solves your problem:

  1. LocaluseStepper() in one component, your own markup. Most flows start and end here.
  2. Guarded — add beforeStepChange when a move needs validation or saving.
  3. Drafts — add data when steps need per-step data for review or persistence.
  4. Shared — move to Provider when the header, panel, and footer are separate components.
  5. Primitives — use Stepper.* for a fully accessible, styled stepper UI.

Each layer is additive. You never rewrite — you reach for the next tool when you need it.

Edit on GitHub

Last updated on

On this page