Skip to content

Steps ​

Introduction ​

The Steps component is used to guide users through completing tasks in a sequential process. mengyue-components has encapsulated this component and conducted vitest testing. You can use <MYSteps></MYSteps> and <MYStep></MYStep> together to implement the steps functionality.

Basic Usage ​

Basic Steps ​

Default horizontal steps bar showing current progress status.

Code Demo
⚪
Step 1
Description for step 1
⚪
Step 2
Description for step 2
⚪
Step 3
Description for step 3
⚪
Step 4
Description for step 4
展开代码

Custom Status ​

Customize the status of each step by setting the Step's status prop.

Code Demo
✔️
Completed
🔵
In Progress
❌
Error
⚪
Pending
展开代码

Custom Icons ​

Customize the icon for each step using slots.

Code Demo
📝
Step 1
✅
Step 2
⏳
Step 3
🎉
Step 4
展开代码

Dynamic Steps ​

Dynamically render steps with data and support interaction.

Code Demo
⚪
Step 1
Fill in basic information
⚪
Step 2
Upload relevant files
⚪
Step 3
Confirm submission
⚪
Step 4
Complete
展开代码

API Reference ​

Steps Props ​

ParameterDescriptionTypeOptionsDefault
activeSet the current active stepnumber—0
directionSteps bar directionstringhorizontal/verticalhorizontal
alignSteps bar alignmentstringleft/center/rightleft
finish-statusStep completion statusstring—finish

Step Props ​

ParameterDescriptionTypeOptionsDefault
titleStep titlestring—Required
descriptionStep descriptionstring—''
statusStep statusstringwait/process/finish/errorAuto-calculated
indexStep indexnumber—Required

Slots ​

Slot NameDescription
iconCustom step icon
defaultStep content

Type Definitions ​

typescript
interface StepsProps {
  active?: number;
  direction?: 'horizontal' | 'vertical';
  align?: 'left' | 'center' | 'right';
  finishStatus?: string;
}

interface StepProps {
  title: string;
  description?: string;
  status?: 'wait' | 'process' | 'finish' | 'error';
  index: number;
}

Released under the MIT License.