About
A multi-step progress indicator for forms and flows that marks finished, current and upcoming steps, lets users go back to a completed step, and can show a step with an error in place of its description.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Stepper to your project and fits it to your theme.
Code
How Stepper is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import * as React from "react";
import Stepper from "@/components/ui/stepper";
export default function StepperVerticalDemo() {
const [current, setCurrent] = React.useState(2);
const [problem, setProblem] = React.useState(true);
const steps = [
{ label: "Request received", description: "Al-Qarawiyyin, Fez" },
{ label: "Copyist assigned", description: "Lubna of C\u00f3rdoba" },
{
label: "Paper and ink",
description: "From the Samarkand mill",
error: problem
? "The paper order was returned. Choose another mill."
: undefined,
},
{ label: "Copy made", description: "About forty days" },
{ label: "Sent", description: "By the Fez caravan" },
];
return (
<div className="grid w-full max-w-sm gap-6">
<Stepper
steps={steps}
current={current}
orientation="vertical"
label="Copy of the Book of Optics"
/>
<div className="flex gap-2">
{problem ? (
<button
type="button"
className="rounded-md border px-3 py-2 text-sm font-medium"
onClick={() => setProblem(false)}
>
Choose another mill
</button>
) : (
<>
<button
type="button"
className="rounded-md border px-3 py-2 text-sm font-medium disabled:opacity-40"
disabled={current >= steps.length}
onClick={() => setCurrent((c) => c + 1)}
>
Next step
</button>
<button
type="button"
className="rounded-md px-3 py-2 text-sm font-medium"
onClick={() => {
setCurrent(2);
setProblem(true);
}}
>
Start over
</button>
</>
)}
</div>
</div>
);
}















