Navigation
Stepper
Free15.5 KB gzippedMulti-step progress indicator for wizards and checkout flows, rendered as an ordered list in a labelled group (or a nav when steps are clickable). The current step gets aria-current="step", and every step announces its status as hidden text. Status also shows as marker icon and shape: check (complete), accent ring (current), number (upcoming), alert square (error).
Accessibility: WCAG 2.2 AA · No A or AA violations in light or dark mode · Keys: Tab · Full report
Import
import { Stepper } from "@vjdesigns/vjdesigns-ui";
Importing only Stepper adds about 15.5 KB of minified, gzipped JavaScript to your app (React not included). The stylesheet is shared by every component and loaded once: 75.1 KB gzipped.
Examples
Checkout
Steps before activeStep are complete. Status is shown with a check or number, not color alone.
- Step 1: Cart, Completed
- Step 2: Shipping, Current
- Step 3: Payment, Not started
- Step 4: Review, Not started
import { useState } from "react";
import { Button, Flex, Stack, Stepper } from "@vjdesigns/vjdesigns-ui";
export function Checkout() {
const [step, setStep] = useState(1);
const steps = ["Cart", "Shipping", "Payment", "Review"];
return (
<Stack gap={6} style={{ width: "100%" }}>
<Stepper activeStep={step} onActiveStepChange={setStep} aria-label="Checkout progress">
{steps.map((title) => (
<Stepper.Step key={title} title={title} />
))}
</Stepper>
<Flex gap={3} justify="end">
<Button variant="ghost" tone="neutral" disabled={step === 0} onClick={() => setStep(step - 1)}>
Back
</Button>
<Button disabled={step === steps.length} onClick={() => setStep(step + 1)}>
{step >= steps.length - 1 ? "Place order" : "Next"}
</Button>
</Flex>
</Stack>
);
}
Vertical
orientation="vertical" with descriptions. clickable lets people jump back to finished steps.
import { Stepper } from "@vjdesigns/vjdesigns-ui";
export function Vertical() {
return (
<Stepper orientation="vertical" defaultActiveStep={2} clickable aria-label="Account setup">
<Stepper.Step title="Create account" description="Email and password" />
<Stepper.Step title="Verify email" description="Check your inbox" />
<Stepper.Step title="Invite team" description="Optional, you can skip this" />
<Stepper.Step title="Start building" />
</Stepper>
);
}
Accessibility
Each step's status is announced ("Completed", "Current step") and shown by shape and an icon, not just color. announce reads the new step out when it changes, and aria-label names the stepper.
- Step 1: Cart, Completed
- Step 2: Shipping, Current
- Step 3: Payment, Not started
import { useState } from "react";
import { Button, Flex, Stack, Stepper } from "@vjdesigns/vjdesigns-ui";
export function Accessibility() {
const [step, setStep] = useState(1);
return (
<Stack gap={5} style={{ width: "100%" }}>
<Stepper aria-label="Checkout progress" activeStep={step} onActiveStepChange={setStep} announce>
<Stepper.Step title="Cart" />
<Stepper.Step title="Shipping" />
<Stepper.Step title="Payment" />
</Stepper>
<Flex gap={3}>
<Button variant="outline" tone="neutral" disabled={step === 0} onClick={() => setStep((s) => s - 1)}>
Back
</Button>
<Button disabled={step === 2} onClick={() => setStep((s) => s + 1)}>
Continue
</Button>
</Flex>
</Stack>
);
}
Translated
The status words and the step-change announcement come from the locale (Brazilian Portuguese here). The step titles are your own text.
- Etapa 1: Carrinho, Concluído
- Etapa 2: Entrega, Atual
- Etapa 3: Pagamento, Não iniciado
import { Stepper, LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import ptBR from "@vjdesigns/vjdesigns-ui/locales/pt-BR";
export function Translated() {
return (
<LocaleProvider locale="pt-BR" messages={ptBR}>
<Stepper aria-label="Etapas do pedido" defaultActiveStep={1} style={{ width: "100%" }}>
<Stepper.Step title="Carrinho" />
<Stepper.Step title="Entrega" />
<Stepper.Step title="Pagamento" />
</Stepper>
</LocaleProvider>
);
}
Right to left
The first example again, inside a right-to-left LocaleProvider (Arabic). Layout, spacing and arrow icons mirror, and the components' built-in text is translated. The example's own text stays in English.
Checkout
- الخطوة 1: Cart, مكتملة
- الخطوة 2: Shipping, الحالية
- الخطوة 3: Payment, لم تبدأ
- الخطوة 4: Review, لم تبدأ
import { LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import ar from "@vjdesigns/vjdesigns-ui/locales/ar";
// Checkout is the "Checkout" example above.
<LocaleProvider locale="ar" messages={ar}>
<Checkout />
</LocaleProvider>
API reference
Stepper
| Prop | Type | Default |
|---|---|---|
activeStepIndex of the active (current) step, zero-based. Controlled. Set it to the number of steps to show every step complete. | number | — |
defaultActiveStepInitial active step when uncontrolled. | number | 0 |
onActiveStepChangeCalled with the new step index when a clickable step is chosen. | (index: number) => void | — |
orientationLayout direction. Pass an object to switch at breakpoints (mobile first), e.g. | Responsive<Orientation> | "horizontal" |
sizeMarker size, spacing, and type size. | "sm""md""lg" | "md" |
clickableMakes steps buttons that call | boolean | false |
linearWhen | boolean | true |
compactNarrow-width behaviour of a horizontal stepper. See | falsetrue"auto" | "auto" |
announceAnnounce active-step changes in a polite live region ("Step 2 of 4: Shipping"). Leave off when your page already moves focus to the new step's heading, so the change isn't read twice. | boolean | false |
announcementBuilds the live-region text when | (info: StepperAnnouncementInfo) => string | — |
statusLabelsOverrides the screen-reader status text ("Completed", "Current", "Not started", "Error"). | StepperStatusLabels | — |
aria-labelAccessible name for the stepper. | string | "Progress" |
children
| ReactNode | — |
refRef to the root element (a | Ref<HTMLElement> | — |
Also accepts native <div> attributes, plus className, style and ref.
Stepper.Step
One step. Its number and default status come from its position.
| Prop | Type | Default |
|---|---|---|
titleRequiredStep name, in bold display type. Keep it short ("Shipping", "Payment"). | ReactNode | — |
descriptionSupporting text under the title. Hidden in compact mode. | ReactNode | — |
iconIcon shown in the marker instead of the step number for | ReactNode | — |
statusOverrides the status derived from | "complete""current""upcoming""error" | — |
disabledPrevents choosing this step in a clickable stepper. | boolean | — |
statusLabelOverrides the screen-reader status text for this step. | string | — |
Also accepts native <li> attributes, plus className, style and ref.
See what changed in each version in the Changelog.
Accessibility report
Stepper targets WCAG 2.2 AA. Below: a live axe-core audit of this page's examples, Lighthouse scores for the page in both modes, the accessibility behavior built into the component, and the checks only a person can do.
axe-core audit (live)
Checking the examples above…
Lighthouse audit
Light mode
Score 10035 passed · 0 failed · 30 not applicable · 10 to check by hand
Dark mode
Score 10035 passed · 0 failed · 30 not applicable · 10 to check by hand
Lighthouse 13.5.0 audits the whole docs page (header and sidebar included), not just the examples, in English. Last run 11/27/2026. Some failed audits carry no weight in the score, so a page can score 100 and still list one.
Built-in behavior
Keyboard
| Key | Action |
|---|---|
| Tab | Interactive steppers: moves through the step buttons; Enter or Space goes to that step. |
Roles and states
| Element | Role | States and properties |
|---|---|---|
| Stepper | list (in a group, or a navigation when interactive) | aria-label |
| Step | listitem | aria-current="step" on the current one |
| Live region | status | Announces the step change |
Manual checks
Automated tools find roughly a third of accessibility issues. Test these in your app, with your content.
| Check | What to test | WCAG 2.2 |
|---|---|---|
| Keyboard | Every action works with Tab, Shift+Tab, Enter, Space and the arrow keys, and focus never gets stuck. | 2.1.1 (A), 2.1.2 (A) |
| Focus | Focus moves in a logical order, is always visible, and isn't hidden behind sticky headers. | 2.4.3 (A), 2.4.7 (AA), 2.4.11 (AA), 2.4.13 (AAA) |
| Screen readers | Names, roles and states are announced correctly, and status changes are announced without moving focus. | 1.3.1 (A), 4.1.2 (A), 4.1.3 (AA) |
| Color | Meaning never depends on color alone; your own colors meet contrast in both modes. | 1.4.1 (A), 1.4.3 (AA), 1.4.11 (AA), 1.4.6 (AAA) |
| Zoom and reflow | At 200% text size and at 320px wide (400% zoom), nothing is cut off and no sideways scrolling is needed. | 1.4.4 (AA), 1.4.10 (AA), 1.4.12 (AA) |
| Pointer targets | Click and tap targets are at least 24×24px (44×44px for AAA), or spaced so they don't overlap. | 2.5.8 (AA), 2.5.5 (AAA) |
| Motion | Animations respect the reduced-motion setting. | 2.3.3 (AAA) |