Skip to main content
Clever Ops

Flow Stepper

Controlled multi-step progress stepper, numbered nodes on a hairline spine, completed ticks that draw in, a current node that pulses exactly once, and real links when steps navigate.

Preview & code

Loading Flow Stepper preview

Installation

pnpm dlx shadcn@latest add @cleverui/stepper-flow

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { StepperFlow } from '@/components/ui/stepper-flow'
Exampletsx
'use client'

import { useState } from 'react'
import { StepperFlow } from '@/components/ui/stepper-flow'
import { cn } from '@/lib/utils'

const STEPS = [
  {
    label: 'Account',
    description: 'Workspace name and region',
    href: '#account',
  },
  {
    label: 'Connectors',
    description: 'Warehouse credentials',
    href: '#connectors',
  },
  {
    label: 'Team',
    description: 'Invite editors and viewers',
  },
  {
    label: 'Review',
    description: 'Confirm plan and launch',
  },
]

export default function StepperFlowDemo() {
  const [current, setCurrent] = useState(1)

  return (
    <div className="mx-auto w-full max-w-3xl px-4 py-10 sm:px-6 sm:py-14">
      <p className="mb-8 font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground sm:text-xs">
        Onboarding · Northline
      </p>

      <StepperFlow steps={STEPS} current={current} ariaLabel="Setup progress" />

      <div className="mt-10 flex flex-wrap items-center gap-3 border-t border-border/60 pt-8">
        <button
          type="button"
          disabled={current === 0}
          onClick={() => setCurrent((c) => Math.max(0, c - 1))}
          className={cn(
            'inline-flex h-10 items-center rounded-lg border border-border/60 bg-card px-4 text-sm font-medium text-foreground',
            'transition-colors duration-150 hover:bg-accent disabled:pointer-events-none disabled:opacity-40',
            'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-hidden'
          )}
        >
          Back
        </button>
        <button
          type="button"
          disabled={current >= STEPS.length - 1}
          onClick={() => setCurrent((c) => Math.min(STEPS.length - 1, c + 1))}
          className={cn(
            'inline-flex h-10 items-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground',
            'transition-colors duration-150 hover:bg-primary/90 disabled:pointer-events-none disabled:opacity-40',
            'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-hidden'
          )}
        >
          {current >= STEPS.length - 1 ? 'Done' : 'Continue'}
        </button>
        <span className="ml-auto font-mono text-[11px] tabular-nums text-muted-foreground">
          Step {current + 1} of {STEPS.length}
        </span>
      </div>
    </div>
  )
}

API reference

StepperFlow accepts the following props.

PropTypeDefaultDescription
steps*StepperFlowStep[]3–6 ordered steps; href renders that step as a real link
current*numbercontrolled index of the current step; lower indices render completed
orientation'horizontal' | 'vertical''horizontal'horizontal rail or vertical spine; horizontal stacks to vertical below sm
ariaLabelstring'Progress'accessible name for the stepper

…plus everything from React.HTMLAttributes<HTMLElement>: className, event handlers, aria attributes and the rest pass straight through.

Referenced types

Typestsx
export interface StepperFlowStep {
  label: string
  description?: string
  /** when set, the step renders as a real link (typically completed steps) */
  href?: string
}

Frequently asked questions

How do I install the Flow Stepper component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/stepper-flow`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Flow Stepper require?

Flow Stepper uses motion and lucide-react on top of React and Tailwind CSS. You don't need to install them manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Flow Stepper to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services