Skip to content

Steps

A navigation bar that guides users through a process to complete tasks. Combines the best features from Element Plus, Naive UI, and Ant Design, and introduces navigation style and clickable switching functionality.

Basic Usage

A simple steps component. Set the active prop, which accepts a number representing the index of the currently active step (starting from 0).

Step 1
This is a description
Step 2
This is a description
Step 3
This is a description
Basic Usage

Vertical Steps

Set direction="vertical" to display steps vertically.

Step 1
This is a description
Step 2
This is a description
Step 3
This is a description
Vertical Steps

Simple Style

Set simple to enable a simplified style for the steps.

Step 1
Step 2
Step 3
Simple Style

Dot Steps

Set progress-dot to enable dot-style steps.

Step 1
This is a description
Step 2
This is a description
Step 3
This is a description
Dot Steps

Set progress-dot="navigation" to enable navigation-style steps, suitable for workflow guidance scenarios.

Step 1
Confirm Order
Step 2
Payment
Step 3
Complete
Navigation Style

Step Status

Use the status prop to customize the status of each step. Supports five statuses: wait, process, finish, error, and success.

Finished
0
In Progress
Error
0
Waiting
Success
In Progress
Waiting
Step Status

Center Alignment

Set align-center to center-align the step content.

Step 1
This is a description
Step 2
This is a description
Step 3
This is a description
Center Alignment

Clickable Steps

Set clickable to allow switching steps by clicking. Needs to be used with the @change event.

Step 1
Step 2
Step 3

Current Step: 1

Clickable Steps

Custom Spacing

Use the space prop to set the spacing between each step, supporting numbers (px) or percentage strings.

Step 1
Step 2
Step 3
Step 1
Step 2
Step 3
Custom Spacing

Finish Status

Use finish-status to set the status of finished steps, default is finish, optional values include success.

Step 1
Step 2
Step 3
Finish Status

Custom Slots

Use icon, title, and description slots to customize step content.

🎉
Custom Title
Custom description content
Step 2
Normal Step
Complete
Custom Slots

Use in Nuxt

The component is fully adapted for Nuxt 3, supporting auto-import and SSR.

Step 1
Step 2
Step 3
Nuxt Adaptation

Small Size

Set size="small" to use a more compact small-sized steps.

Step 1
Description
Step 2
Description
Step 3
Description
Small Size

Responsive Layout

When responsive is set, it automatically switches to vertical layout when the window width is below the breakpoint (default 768px).

Step 1
This is a description
Step 2
This is a description
Step 3
This is a description
Responsive Layout

Progress Line

After setting show-progress, the connecting line will display as a progress bar. Combined with the progress prop of Step, it can show the completion progress of the current step.

Step 1
Step 2
Step 3
Current Step Progress: 50%
Progress Line

Timeline Mode

After setting show-timeline, time information can be displayed, suitable for logistics tracking, history records, etc.

2024-01-01 10:00
Order Created
Order submitted
2024-01-01 10:05
Payment Successful
Payment completed
2024-01-02 08:00
Item Shipped
Logistics picked up
Confirm Receipt
Waiting for delivery
Timeline Mode

Disabled Step

Set the disabled prop on Step to disable clicking on that step.

Step 1
Step 2 (Disabled)
Step 3

Current Step: 0, Step 2 is disabled and cannot be clicked

Disabled Step

Label Placement

Set label-placement="vertical" to arrange labels vertically.

Step 1
This is a description
Step 2
This is a description
Step 3
This is a description
Label Placement

Lazy Rendering

Set the lazy prop on Step to lazy-render content, which will only be rendered when first activated, improving performance.

Step 1
Step 1 detailed content (loaded immediately)
Step 2
Step 3
Lazy Rendering

API

Steps Props

PropDescriptionTypeDefault
activeCurrently active step (starting from 0)number0
directionDisplay direction'horizontal' | 'vertical''horizontal'
align-centerWhether to center alignbooleanfalse
simpleWhether to enable simple stylebooleanfalse
progress-dotDot/navigation styleboolean | 'dot' | 'navigation'false
finish-statusFinished step status'wait' | 'process' | 'finish' | 'error' | 'success''finish'
process-statusCurrent step status'wait' | 'process' | 'finish' | 'error' | 'success''process'
spaceSpace between each step (supports px or percentage)number | string
clickableWhether steps are clickablebooleanfalse
sizeSize'default' | 'small''default'
responsiveWhether responsive (auto switch to vertical on small screens)booleanfalse
responsive-breakpointResponsive breakpoint (px)number768
label-placementLabel placement'horizontal' | 'vertical''horizontal'
show-progressShow progress bar connecting linebooleanfalse
show-timelineShow timelinebooleanfalse

Steps Events

Event NameDescriptionType
changeTriggered when step is clicked (requires clickable enabled)(index: number) => void

Steps Slots

Slot NameDescriptionParameters
defaultStep component content

Step Props

PropDescriptionTypeDefault
titleTitlestring''
descriptionDescription textstring''
iconCustom icon class namestring''
statusCurrent step status (overrides parent setting)'wait' | 'process' | 'finish' | 'error' | 'success'''
disabledWhether to disable this stepbooleanfalse
timeTime information (for timeline mode)string''
progressProgress percentage (0-100, for progress bar mode)number0
lazyWhether to lazy render contentbooleanfalse

Step Slots

Slot NameDescriptionParameters
defaultCustom content area
iconCustom icon
titleCustom title
descriptionCustom description
timeCustom time content

Theme Variables

VariableDescriptionDefault
--yh-steps-icon-sizeIcon area size28px
--yh-steps-line-colorLine colorvar(--yh-border-color-light)
--yh-steps-finish-colorFinished status colorvar(--yh-color-primary)
--yh-steps-process-colorIn progress status colorvar(--yh-color-primary)
--yh-steps-wait-colorWaiting status colorvar(--yh-text-color-placeholder)
--yh-steps-error-colorError status colorvar(--yh-color-danger)
--yh-steps-success-colorSuccess status colorvar(--yh-color-success)

Released under the MIT License.