Step Indicator
nswds-ui/step-indicatorFreeComponent
Ordered multi-step progress list with status markers (completed, saved, in progress, error, cannot start) and an aria-current step, plus a sectioned StepNav wrapper.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/digitalnsw/nswds-ui/main/apps/registry/public/r/step-indicator.jsonSource
1'use client'23import React from 'react'45import { cn } from '@/lib/utils'67import { Link } from '@/components/link'8import { IconCheck } from '@/icons/check'9import { IconError } from '@/icons/error'10import { IconMoreHoriz } from '@/icons/more-horiz'11import { IconRemove } from '@/icons/remove'1213/**14 * Progress state of a single step in a multi-step journey.15 *16 * `'default'` is the unannotated baseline (a step with no `status` set) and17 * renders identically to `'not-started'` — both exist because the nswds-app18 * source distinguished them, and consumers may key behaviour off the19 * difference even though the visual is shared.20 */21type StepStatus =22 'default' | 'not-started' | 'in-progress' | 'completed' | 'saved' | 'error' | 'cannot-start'2324/** One entry in a {@link StepIndicator} list. */25type Step = {26 /** Visible step name, e.g. "Your details". */27 title: string28 /** Optional second line under the title. */29 description?: string30 /** Navigation target; also the identity compared against `currentHref`. */31 href: string32 /** Progress state. Omitted = `'default'` (renders as not started). */33 status?: StepStatus34}3536/**37 * Per-status visual treatment, collapsed from the nswds-app source's seven38 * copy-pasted JSX branches into one map. Every colour funnels through a single39 * `--step-ink` custom property declared on the `<li>`, so the marker,40 * connector, hover fill and focus ring all follow from one declaration per41 * status (the same ink-token pattern as footer.tsx / link.tsx).42 *43 * Ink values use RAW @nswds/tokens custom properties (`--success-600`, not the44 * `--color-success-600` Tailwind bridge alias): Tailwind v4 tree-shakes45 * unreferenced `@theme` keys and an arbitrary-property reference is not a46 * usage signal, but the raw tokens are plain `:root` declarations that always47 * resolve — the same precedent as button.tsx's semantic colours.48 *49 * Token remapping from the nswds-app source (documented per §3 of AGENTS.md):50 * - completed/saved: `success-450`/`-500`/`-550` → `--success-600` (dark:51 * `--success-500`). 450 (L≈0.63) gives the white check only ≈2.4:1; 60052 * (L≈0.55) clears the 3:1 non-text minimum (WCAG 2.2 1.4.11) and matches53 * Button's solid success.54 * - in-progress: `primary-500` → `--primary-600` (dark: `--primary-450`).55 * Masterbrand primary-500 (L≈0.72) fails 3:1 against white for the marker56 * border and icon; 600 matches Button's tertiary. The dark override57// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from @nswds/ui
All 46 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Aspect Ratioaspect-ratio | @nswds/ui | Components | Free | 2 deps · 2 files | |
| Badgebadge | @nswds/ui | Components | Free | 4 deps · 2 files | |
| Buttonbutton | @nswds/ui | Components | Free | 4 deps · 2 files | |
| Cardcard | @nswds/ui | Components | Free | 2 deps · 2 files | |
| Collapsiblecollapsible | @nswds/ui | Components | Free | 1 dep | |
| Drawerdrawer | @nswds/ui | Components | Free | 3 deps · 2 files | |
| Expandable Searchexpandable-search | @nswds/ui | Components | Free | 3 deps · 2 files | |
| Fieldfield | @nswds/ui | Components | Free | 4 deps · 2 files |
