Examples

Checkout navigation

Preview

Editing shipping details.

Example.tsx
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

Preview
  1. Create a workspaceCompleted
  2. Verify your domainAdd a DNS record to continueNeeds attention
  3. Invite your team
Example.tsx
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

Stepper props
PropTypeDefault
aria-labelrequired
Names the list of steps.
string—
stepsrequired
Each step has a stable id, label, and optional description, status, or disabled state.
readonly StepperItem[]—
activeSteprequired
ID of the step marked current.
string—
onStepChange
Called when an available step is activated. Without a callback, steps are read-only.
(id: string) => void—
orientation
Horizontal steps wrap when space is limited.
'horizontal' | 'vertical''horizontal'
messages
Translate 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.

AttributeValues
[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.

Keyboard interactions
KeyAction
TabMove between available step buttons
Enter or SpaceNavigate 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.