Progress Tracker

ProgressTracker displays workflow progress as a row of status segments.

tsx
import { ProgressTracker } from '@/components/ui/wideset/progress-tracker/ProgressTracker';

<ProgressTracker
  steps={[
    { tooltip: { children: 'Cart' } },
    { tooltip: { children: 'Shipping' } },
    { tooltip: { children: 'Payment' } },
    { tooltip: { children: 'Review' } },
    { tooltip: { children: 'Confirmation' } },
  ]}
  activeStep={2}
/>

Installation

pnpm dlx wideset add progress-tracker

Copies the component and any Wideset components it uses into your project.

Examples

Statuses

activeStep sets the statuses for you: segments before it are completed, the segment itself is active, the rest are incomplete. Set status: 'error' on a step to flag one the user has to go back and fix; it overrides the computed status and leaves the others alone. Screen readers hear the tracker as a progressbar whose value is activeStep, so keep it pointing at the real step even when you override statuses, and name each step in its tooltip.

tsx
import { ProgressTracker } from '@/components/ui/wideset/progress-tracker/ProgressTracker';

export default function ProgressTrackerStatuses() {
  return (
    <div className="w-[20rem] max-w-full">
      <ProgressTracker
        activeStep={3}
        steps={[
          { tooltip: { children: 'Cart' } },
          { status: 'error', tooltip: { children: 'Shipping' } },
          { tooltip: { children: 'Payment' } },
          { tooltip: { children: 'Review' } },
          { tooltip: { children: 'Confirmation' } },
        ]}
      />
    </div>
  );
}

API reference

ProgressTracker

NameDescriptionDefault
activeStep

Index of the currently active step. Steps before it are marked completed; steps after are incomplete. Clamped to `[0, stepsCount]`.

number
0
children

Compose steps manually using `ProgressTracker.Step`. Takes precedence over `steps`.

ReactNode
—
interactive

Renders each step as a `<button>`. Enables hover/active states and `onStepClick`.

boolean
false
onStepClick

Callback fired when a step is clicked. Receives the zero-based `stepIndex`.

((stepIndex: number) => void)
—
stepAriaLabel

Accessible name of each interactive step button, from its zero-based index. Defaults to `Step 1`, `Step 2`, …

((stepIndex: number) => string)
—
steps

Array-driven step definitions. Each entry may have an optional `status` override and `tooltip`. Mutually exclusive with `children`.

ProgressTrackerStep[]
—
Every other prop of <div> is passed through to it. See MDN: <div>.

ProgressTracker.Step

NameDescriptionDefault
status

Visual status of the step segment. When omitted, status is derived automatically from `activeStep`.

'error''completed''incomplete''active'
'incomplete'
stepIndexnumber0
tooltip

Tooltip shown on hover. Accepts Tooltip.Content props.

TooltipContentProps
—
Every other prop of <div> is passed through to it. See MDN: <div>.

Accessibility

  • Non-interactive: role="progressbar" with value activeStep out of the step count. Keep activeStep pointing at the real step even when you override statuses.
  • Interactive: a group of buttons; set stepAriaLabel to real step names ((i) => names[i]).
  • Give the tracker an aria-label; it has no name by default.
PartRendersDescription
ProgressTracker<div>A compact row of progress segments with optional tooltips.
ProgressTracker.Step<div>An individual stage in the progress indicator.
tsx
import { ProgressTracker } from '@/components/ui/wideset/progress-tracker/ProgressTracker';

<ProgressTracker
  steps={[
    { tooltip: { children: 'Cart' } },
    { tooltip: { children: 'Shipping' } },
    { tooltip: { children: 'Payment' } },
    { tooltip: { children: 'Review' } },
    { tooltip: { children: 'Confirmation' } },
  ]}
  activeStep={2}
/>

State

Active step
Payment failed

Behavior

Clickable steps