Skip to content
Klarhimmel UI

Stepper

  1. Dates, Completed
  2. Guests, Current step
  3. Payment, Upcoming
  4. Done, Upcoming
npx shadcn add @klarhimmel/stepper

Examples

  • Basic

  • Descriptions

  • Narrow

DetailsAbout, usage, props and more

Where someone is in a flow: numbered steps, the current one marked, each step's state said in words.

When to use

  • Use for

    Showing progress through checkout, booking or onboarding.

  • Not for

    A percentage. Use Progress. Switching between views. Use Tabs.

  • Pairs with

    Button, Progress, a heading per step.

Preview

  1. Dates, Completed
  2. Guests, Current step
  3. Payment, Upcoming
  4. Done, Upcoming
stepper.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { Stepper } from '@/components/klarhimmel/ui/stepper';

export default function Example() {
  return (
    <Theme theme="brand">
      <Stepper
        aria-label="Booking progress"
        current={1}
        steps={[{ label: 'Dates' }, { label: 'Guests' }, { label: 'Payment' }]}
      />
    </Theme>
  );
}

Import

Import

import { Stepper } from '@/components/klarhimmel/ui/stepper';
Files
stepper.tsx, in components/klarhimmel/ui/. With it: theme, utils. npm: lucide-react.
Render in
Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.

Props

PropTypeDefaultDescription
stepsStepperStep[]requiredRequired, in order.
currentnumberrequiredThe step the person is on, counting from 0. Steps before it are complete; steps after it are upcoming.
aria-labelstringrequiredNames the list. Required: "Booking progress".
labels{ complete: string; current: string; upcoming: string }{ complete: 'Completed', current:…What assistive tech hears beside each step, so state is never colour alone. Pass them translated.
onStepSelect(index: number) => void-With this, a completed step is a button that goes back to it.
classNamestring-Extra classes, merged after the component's own.

Accessibility

KeyDoes
TabReaches completed steps when onStepSelect is given
Enter / SpaceGoes back to the focused completed step

An ordered list; the current step is aria-current="step" and every step says its state in words, so state is never colour alone.

Accessibility