ebnsina

Stepper

Navigation

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>
  );
}

Dependencies

More by ebnsina

View all
  • Countdown Timer

    Countdown Timer

    35
  • Video Player

    Video Player

    26
  • Alarm Clock

    Alarm Clock

    24
  • Hourglass Timer

    Hourglass Timer

    19
  • Voice Note

    Voice Note

    19
  • Sortable List

    Sortable List

    18
  • Sign In Auth Card

    Sign In Auth Card

    14
  • Split Button

    Split Button

    13

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    67
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    193
  • Sidebar

    Sidebar

    408
  • Button Breadcrumb

    Button Breadcrumb

    34
  • Menu

    Menu

    26
  • Breadcrumb

    Breadcrumb

    7
  • Pagination with Ellipsis

    Pagination with Ellipsis

    25
  • Pagination with Icon and Label

    Pagination with Icon and Label

    24