Skip to content

Steps

A navigation component that guides users through a multi-step process. It supports horizontal and vertical layouts, clickable navigation, progress display, timeline mode, and component-level theme overrides.

Basic Usage

Set the active prop to the current step index. The index starts 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 render 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 the simplified layout.

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 display navigation-style step dots.

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

Step Status

Use the status prop on YhStep to override the state of a specific step.

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

Center Alignment

Set align-center to center-align 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 step switching by click and listen for the change event.

Step 1
Step 2
Step 3

Current Step: 1

Clickable Steps

Custom Spacing

Use space to control the width basis of each step. It supports numbers and CSS size strings.

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

Finish Status

Use finish-status to customize the state applied to completed steps.

Step 1
Step 2
Step 3
Finish Status

Custom Slots

Use the icon, title, description, and time slots on YhStep to customize display content.

1
Custom Title
Custom description content
Step 2
Normal Step
OK
Complete
Custom Slots

Use in Nuxt

YhSteps and YhStep can be used directly in Nuxt 3 after the YH-UI Nuxt module is registered.

Step 1
Step 2
Step 3
Nuxt Adaptation

Small Size

Set size="small" for a denser steps layout.

Step 1
Description
Step 2
Description
Step 3
Description
Small Size

Responsive Layout

Set responsive to let horizontal steps switch to vertical layout below the configured breakpoint.

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 connector line displays the progress value of the active step.

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

Timeline Mode

Set show-timeline to display timeline information, then provide the time prop or time slot on each step.

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 disabled on YhStep to prevent it from being clicked.

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 stack labels and descriptions vertically.

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

Lazy Rendering

Set lazy on YhStep to render the default slot only after the step becomes active for the first time.

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

API

Props

Steps

PropDescriptionTypeDefault
activeCurrently active step index.number0
directionLayout direction of the steps container.YhStepsDirection'horizontal'
align-centerWhether step content is center-aligned.booleanfalse
simpleWhether to use the simplified style.booleanfalse
progress-dotDot mode configuration.boolean | YhStepsProgressDotfalse
finish-statusStatus applied to completed steps.YhStepsStatus'finish'
process-statusStatus applied to the current active step.YhStepsStatus'process'
spaceWidth basis for each step.number | string''
clickableWhether clicking a step can trigger changes.booleanfalse
sizeSteps size.YhStepsSize'default'
responsiveWhether to switch to a vertical layout below the breakpoint.booleanfalse
responsive-breakpointBreakpoint used by responsive mode, in pixels.number768
label-placementPlacement mode of labels.YhStepsLabelPlacement'horizontal'
show-progressWhether to show connector progress.booleanfalse
show-timelineWhether to render steps in timeline mode.booleanfalse
theme-overridesComponent-level theme overrides for YhSteps.ComponentThemeVarsundefined

Step

PropDescriptionTypeDefault
titleStep title.string''
descriptionStep description text.string''
iconIcon class name rendered in the head area.string''
statusStep status that overrides the parent-computed status.YhStepsStatus | ''''
disabledWhether the step is disabled.booleanfalse
timeTimeline text used in timeline mode.string''
progressProgress value used when show-progress is enabled.number0
lazyWhether default slot content is rendered lazily after first activation.booleanfalse
theme-overridesComponent-level theme overrides for YhStep.ComponentThemeVarsundefined

Events

Steps

Event NameDescriptionType
changeTriggered when a clickable step is selected.(index: number) => void

Step

Current component does not expose component events.

Slots

Steps

Slot NameDescriptionParameters
defaultStep content. Usually contains YhStep nodes.-

Step

Slot NameDescriptionParameters
iconCustom icon area content.-
titleCustom title content.-
descriptionCustom description content.-
defaultAdditional custom content rendered below the description.-
timeCustom timeline time content when timeline mode is enabled.-

Expose

YhSteps and YhStep do not expose public instance methods or properties.

Theme Variables

YhSteps and YhStep support themeOverrides. The steps runtime consumes the following component variables:

VariableDescriptionDefault
--yh-steps-icon-sizeSize of the icon circle area.28px
--yh-steps-line-colorConnector line color.var(--yh-border-color-light)
--yh-steps-finish-colorCompleted step color.var(--yh-color-primary)
--yh-steps-process-colorCurrent active step color.var(--yh-color-primary)
--yh-steps-wait-colorWaiting step color.var(--yh-text-color-placeholder)
--yh-steps-error-colorError step color.var(--yh-color-danger)
--yh-steps-success-colorSuccess step color.var(--yh-color-success)

Type Exports

NameDescription
YhStepsPropsSteps component props type
YhStepsEmitsSteps component emits type
YhStepsSlotsSteps component slots type
YhStepsDirectionDirection union
YhStepsStatusStatus union
YhStepsProgressDotDot mode type
YhStepsSizeSize union
YhStepsLabelPlacementLabel placement union
YhStepConfigStep config type
YhStepPropsStep component props type
YhStepSlotsStep component slots type
YhStepsInstanceSteps component instance type
YhStepInstanceStep component instance type

Released under the MIT License.