Back to Chakra Ui

Steps

apps/www/content/docs/components/steps.mdx

0.3.0-beta2.1 KB
Original Source
<ExampleTabs name="steps-basic" />

Usage

tsx
import { Steps } from "@chakra-ui/react"
tsx
<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.

<ExampleTabs name="steps-with-sizes" />

Variants

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

<ExampleTabs name="steps-with-variants" />

Colors

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

<ExampleTabs name="steps-with-colors" />

Trigger

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

<ExampleTabs name="steps-with-trigger" />

Vertical

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

<ExampleTabs name="steps-vertical" />

Controlled

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

<ExampleTabs name="steps-controlled" />

Validation

Use the isStepValid prop to validate each step before allowing navigation. Use the onStepInvalid prop to handle invalid step transitions.

<ExampleTabs name="steps-with-validation" />

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.

<ExampleTabs name="steps-with-store" />

Icon

Pass the icon prop to the StepsItem component to display an icon.

<ExampleTabs name="steps-with-icon" />

Description

Pass the description prop to the StepsItem component to display a description.

<ExampleTabs name="steps-with-description" />

Props

Root

<PropTable component="Steps" part="Root" />

Explorer

Explore the Steps component parts interactively. Click on parts in the sidebar to highlight them in the preview.

<Explorer name="steps-explorer-demo" />