Navigation
Stepper
Show where someone is in a checkout, setup, or approval workflow, with the option to revisit available steps.
import { Stepper } from '@reactloom/ui';Examples
Checkout navigation
Editing shipping details.
import { useState } from 'react';
import { Stack, Stepper, type StepperItem } from '@reactloom/ui';
const steps: StepperItem[] = [
{ id: 'cart', label: 'Cart', status: 'complete' },
{ id: 'shipping', label: 'Shipping', description: 'Choose an address' },
{ id: 'payment', label: 'Payment', disabled: true },
];
export default function Example() {
const [activeStep, setActiveStep] = useState('shipping');
return (
<Stack gap="3">
<Stepper aria-label="Checkout steps" steps={steps} activeStep={activeStep} onStepChange={setActiveStep} />
<p role="status">Editing {activeStep === 'cart' ? 'cart items' : 'shipping details'}.</p>
</Stack>
);
}Workspace setup progress
- Create a workspaceCompleted
- Verify your domainAdd a DNS record to continueNeeds attention
- Invite your team
import { Stepper } from '@reactloom/ui';
export default function Example() {
return (
<Stepper aria-label="Workspace setup" orientation="vertical" activeStep="domain" steps={[
{ id: 'create', label: 'Create a workspace', status: 'complete' },
{ id: 'domain', label: 'Verify your domain', status: 'error', description: 'Add a DNS record to continue' },
{ id: 'invite', label: 'Invite your team' },
]} />
);
}API reference
| Prop | Type | Default |
|---|---|---|
aria-labelrequiredNames the list of steps. | string | — |
stepsrequiredEach step has a stable id, label, and optional description, status, or disabled state. | readonly StepperItem[] | — |
activeSteprequiredID of the step marked current. | string | — |
onStepChangeCalled when an available step is activated. Without a callback, steps are read-only. | (id: string) => void | — |
orientationHorizontal steps wrap when space is limited. | 'horizontal' | 'vertical' | 'horizontal' |
messagesTranslate status text. | Partial<{ complete: string; error: string }> | — |
Customization
Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.
State attributes
Target these in your CSS to style states without depending on class names.
| Attribute | Values |
|---|---|
[data-orientation] | horizontal · vertical |
[data-status] | present when on |
Theme tokens it reads
--pl-color-accent-solid --pl-color-bg-muted --pl-color-bg-subtle --pl-color-border-default --pl-color-danger-fg --pl-color-fg-default --pl-color-fg-muted --pl-color-fg-on-accent --pl-focus-ring-color --pl-focus-ring-offset --pl-focus-ring-width --pl-font-size-sm --pl-radius-full --pl-radius-md
Accessibility
The list marks the active item with aria-current="step". A completed or invalid step includes a text label. Available actions use native buttons.
| Key | Action |
|---|---|
| Tab | Move between available step buttons |
| Enter or Space | Navigate to the focused step |
Usage guidelines
Do
- Describe the task at each step and gate forward navigation using your form validation.
Don’t
- Keep interactive elements out of step labels when the steps are actionable.