import{o as t,a,y as n}from"./vue-libs.b44bc779.js";const e={class:"van-doc-markdown-body"},l=n(`

Steps

Intro

Used to show the various parts of the action flow and let the user know where the current action fits into the overall flow.

Install

Register component globally via app.use, refer to Component Registration for more registration ways.

import { createApp } from 'vue';
import { Step, Steps } from 'vant';

const app = createApp();
app.use(Step);
app.use(Steps);

Usage

Basic Usage

<van-steps :active="active">
  <van-step>Step1</van-step>
  <van-step>Step2</van-step>
  <van-step>Step3</van-step>
  <van-step>Step4</van-step>
</van-steps>
import { ref } from 'vue';

export default {
  setup() {
    const active = ref(1);
    return { active };
  },
};

Custom Style

<van-steps :active="active" active-icon="success" active-color="#38f">
  <van-step>Step1</van-step>
  <van-step>Step2</van-step>
  <van-step>Step3</van-step>
  <van-step>Step4</van-step>
</van-steps>

Vertical Steps

<van-steps direction="vertical" :active="0">
  <van-step>
    <h3>\u3010City\u3011Status1</h3>
    <p>2016-07-12 12:40</p>
  </van-step>
  <van-step>
    <h3>\u3010City\u3011Status2</h3>
    <p>2016-07-11 10:00</p>
  </van-step>
  <van-step>
    <h3>\u3010City\u3011Status3</h3>
    <p>2016-07-10 09:30</p>
  </van-step>
</van-steps>

API

Steps Props

AttributeDescriptionTypeDefault
activeActive stepnumber | string0
directionCan be set to verticalstringhorizontal
active-colorActive step colorstring#07c160
inactive-colorInactive step colorstring#969799
active-iconActive icon namestringchecked
inactive-iconInactive icon namestring-
finish-icon v3.0.7Finish icon namestring-
icon-prefix v3.0.15Icon className prefixstringvan-icon

Step Slots

NameDescription
defaultStep content
active-iconCustom active icon
inactive-iconCustom inactive icon
finish-icon v3.0.7Custom finish icon

Steps Events

EventDescriptionArguments
click-stepEmitted when a step's title or icon is clickedindex: number

Types

The component exports the following type definitions:

import type { StepsProps, StepsDirection } from 'vant';

Theming

CSS Variables

The component provides the following CSS variables, which can be used to customize styles. Please refer to ConfigProvider component.

NameDefault ValueDescription
--van-step-text-colorvar(--van-text-color-2)-
--van-step-active-colorvar(--van-success-color)-
--van-step-process-text-colorvar(--van-text-color)-
--van-step-font-sizevar(--van-font-size-md)-
--van-step-line-colorvar(--van-border-color)-
--van-step-finish-line-colorvar(--van-success-color)-
--van-step-finish-text-colorvar(--van-text-color)-
--van-step-icon-size12px-
--van-step-circle-size5px-
--van-step-circle-colorvar(--van-gray-6)-
--van-step-horizontal-title-font-sizevar(--van-font-size-sm)-
--van-steps-background-colorvar(--van-background-color-light)-
`,14),p=[l],h={__name:"README",setup(c,{expose:s}){return s({frontmatter:{}}),(o,r)=>(t(),a("div",e,p))}};export{h as default};