Steps

Shows the steps of a process, such as a checkout, and which step the user is on.

Add your name and a photo.

Usage

Code
import { Steps } from '@leverui/components';
Code
<Steps.Root>
  <Steps.List>
    <Steps.Item>
      <Steps.Trigger>
        <Steps.Indicator />
        <Steps.Title />
        <Steps.Description />
      </Steps.Trigger>
      <Steps.Separator />
    </Steps.Item>
  </Steps.List>
  <Steps.Content />
  <Steps.CompletedContent />
  <Steps.PrevTrigger />
  <Steps.NextTrigger />
</Steps.Root>

Examples

Sizes

Use the size prop to change the size of the steps component.

Step 1 description
Step 1 description
Step 1 description

Variants

Use the variant prop to change the appearance of the steps component.

Step 1 description
Step 1 description

Colors

Use the colorPalette prop to change the color scheme of the component.

Step 2 description
Step 2 description
Step 2 description
Step 2 description
Step 2 description
Step 2 description
Step 2 description
Step 2 description
Step 2 description
Step 2 description

Trigger

Use the Steps.Trigger component to make the step clickable.

Add your name and a photo.

Vertical

Use the orientation prop to change the orientation of the steps component.

Add your name and a photo.

Controlled

Use the value and onValueChange props to control the current step of the steps component.

Add your name and a photo.

Validation

Mark an item invalid to stop navigation past it in linear mode. Use the onNavigationBlocked prop to handle the blocked transition.

Store

An alternative way to control the steps is to use the RootProvider component and the useSteps store hook. This way you can access the steps state and methods from outside the steps.

current step: step-1
Add your name and a photo.

Icon

Pass an icon to Steps.Status within Steps.Indicator to display an icon.

Payment

Description

Render a Steps.Description beside the Steps.Title to display a description.

Add your name and a photo.

Guides

count, each item's index and each content panel's index must match. In a form, linear with isStepValid blocks moving on until the current step is valid. onStepInvalid is called when a move is blocked. Give each step a short title and show each validation error next to its field.

Props

Root

PropDefaultTypeDescription
isStepSkippable() => false(index: number) => booleanReturns whether a step can be skipped. Next and previous pass over those.
isStepValid() => true(index: number) => booleanReturns whether a step is valid. In linear mode, an invalid step blocks moving forward.
orientationhorizontal'vertical' | 'horizontal'Steps run across the page or down it.
colorPalettegray'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink'Color palette.
variantsolid'solid' | 'subtle' or responsive mapSteps style.
sizemd'xs' | 'sm' | 'md' | 'lg' or responsive mapSteps size.
asdivNative HTML tagHTML tag to render.
asChild—Solid render functionRender your own element with the root's props.
unstyledfalsebooleanTurn off the Lever UI styles.
count—numberTotal number of steps.
defaultStep—numberCurrent step on first render, when uncontrolled.
ids—ElementIdsYour own ids for the elements inside.
linear—booleanRequire the steps to be completed in order.
onStepChange—(details: StepsChangeDetails) => voidCalled when the current step changes.
onStepComplete—VoidFunctionCalled when a step is completed.
onStepInvalid—(details: StepInvalidDetails) => voidCalled when an invalid step blocks a move.
step—numberCurrent step, when you control it.

Accepts class and style. unstyled also works on a single part.

Customize with CSS

Override the public variables or style the part classes. Every public part, including Number and CompletedContent, has a stable .leverui-steps__* class.

Code
.my-steps {
  --leverui-colors-color-palette-solid: #145a80;
}

.my-steps .leverui-steps__indicator {
  border-radius: 0.5rem;
}

Put the my-steps class on Steps.Root.

Explorer

Click a part name to highlight it in the preview.

Component Anatomy

Hover to highlight, click to select parts