Back to Shark UI

Steps

docs/components/steps

latest7.6 KB
Original Source

Sections

Components

Utilities

Forms

Hooks

Steps

Copy Markdown

Steps in a wizard-like format.

DocsAPI

PreviewCode

1

2

3

Step 1

Step 2

Step 3

All steps completed. You're all set!

NextBack

Installation#

CLIManual

pnpmbunnpmyarn

pnpm dlx shadcn@latest add @shark/steps

Anatomy#

Steps
├── StepsList
│ └── StepsItem
│ ├── StepsTrigger
│ ├── StepsIndicator
│ ├── StepsSeparator
│ ├── StepsTitle
│ └── StepsDescription
├── StepsContent
├── StepsCompletedContent
├── StepsPrevious
└── StepsNext

Usage#

import {
  Steps,
  StepsList,
  StepsItem,
  StepsTrigger,
  StepsSeparator,
  StepsIndicator,
  StepsTitle,
  StepsDescription,
  StepsContent,
  StepsCompletedContent,
  StepsNext,
  StepsPrevious
} from "@/components/ui/steps";
<Steps>
  <StepsList>
    <StepsItem>
      <StepsTrigger>
        <StepsIndicator />
        <StepsTitle />
      </StepsTrigger>
      <StepsSeparator />
    </StepsItem>
  </StepsList>
  <StepsContent />
  <StepsCompletedContent />
  <StepsPrevious />
  <StepsNext />
</Steps>

Examples#

Title#

Use StepsTitle to display a description for each step.

PreviewCode

1 Info

2 Docs

3 Team

Description#

Use StepsDescription to display a description for each step.

PreviewCode

1

InfoPersonal

2

DocsCompany

3

TeamCreate

Vertical#

Use orientation="vertical" for a vertical layout.

PreviewCode

1 InfoPersonal

2 DocsCompany

3 TeamCreate

Personal

Company

Create

Completed

NextBack

Loading#

PreviewCode

2

3

Controlled#

Use the step and onStepChange props to control the active step programmatically.

PreviewCode

1 Your details

2 Company details

3 Invite your team

Please provide your name and email address.

A few details about your company.

Start collaborating with your team.

All steps completed. You're all set!

BackNextReset

Custom Icon#

PreviewCode

API Reference#

Steps#

Root component. Manages step state and connectors.

PropTypeDefault
countnumber-
stepnumber-
defaultStepnumber-
orientation`"horizontal""vertical"`
linearbooleanfalse
onStepChange(details: StepChangeDetails) => void-
onStepComplete() => void-

StepsList#

Wraps the list of steps. Handles connector layout.

AttributeDefault
--steps-gutter--spacing(2)
--steps-icon-size--spacing(4)
--steps-size--spacing(8)

For a complete list of props, see the Ark UI documentation.

[

Previous page

Status ](/docs/components/status)[

Next page

Switch ](/docs/components/switch)

On This Page

InstallationAnatomyUsageExamplesTitleDescriptionVerticalLoadingControlledCustom IconAPI ReferenceStepsStepsList