UnflowUI
Components

Stepper

Shows where a person is in a multi-step flow, horizontal or vertical, with error states, clickable completed steps and a compact mode.

Overview

Stepper renders the steps of a flow and marks each as completed, current, upcoming or failed. Steps before current are completed. With onStepClick, completed steps become buttons, e.g. to go back in a wizard. compact reduces it to "Step n of N" plus the current step's label, for narrow screens.

Import

import { Stepper } from '@unflowio/ui/components/Stepper';

Props

PropTypeDefaultDescription
stepsStepperStep[]—Required. The steps, in order
currentnumber—Required. Index of the current step, from 0
orientation'horizontal' | 'vertical''horizontal'Layout
onStepClick(index: number) => void—Makes completed steps clickable
compactboolean—Shows only "Step n of N" and the current step's label

StepperStep:

FieldTypeDescription
labelReactNodeRequired. Step name
descriptionReactNodeSecondary line under the label
errorbooleanMarks the step as failed, whatever its position

Basic usage

  1. Brand, completed
  2. Workspace, completed
  3. Limits
  4. Sign-in
  5. Billing
  6. Invite
<Stepper steps={steps} current={2} />

Vertical

  1. Upload data, completed1,240 rows
  2. ValidateChecks format and duplicates
  3. ImportAbout 2 minutes
  4. ReviewCompare against the current data
<Stepper steps={steps} current={1} orientation="vertical" />

Error

  1. Upload data, completed1,240 rows
  2. Validate, error12 rows have no email
  3. ImportAbout 2 minutes
  4. ReviewCompare against the current data
<Stepper
  steps={[
    { label: 'Upload data' },
    { label: 'Validate', description: '12 rows have no email', error: true },
    { label: 'Import' },
  ]}
  current={1}
/>

Clickable

  1. Brand, completed
  2. Workspace, completed
  3. Limits, completed
  4. Sign-in
  5. Billing
  6. Invite
const [current, setCurrent] = useState(3);

<Stepper steps={steps} current={current} onStepClick={setCurrent} />

Compact

Step 3 of 6

Limits

<Stepper steps={steps} current={2} compact />

Customization (slotProps)

Slot PropPropsDescription
stepBaseHTMLProps<HTMLLIElement>Each step
markerBaseHTMLProps<HTMLSpanElement>Each step's number or status marker

Accessibility

  • The steps are an ordered list named "Progress" (translated). The current step has aria-current="step".
  • Completed and failed steps add a visually hidden "completed" or "error" after their label, so the state doesn't rely on the marker.
  • Clickable steps are buttons named "Go to step n".
  • In compact mode the visual track is hidden from assistive technology; the "Step n of N" text carries the position.