Skip to content

Progress - Vant 4

Progress ​

Intro ​

Used to show the current progress of the operation.

Install ​

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

js
import { createApp } from'vue'; import { Progress } from'vant'; const app = createApp(); app.use(Progress);

Usage ​

Basic Usage ​

Use percentage prop to set current progress.

html

Stroke Width ​

html

Inactive ​

html

Custom Style ​

Use pivot-text to custom text, use color to custom bar color.

html

API ​

Props ​

AttributeDescriptionTypeDefault
percentagePercentage*numberstring*
stroke-widthStroke width*numberstring*
colorColorstring#1989fa

| track-color | Track color | string | #e5e5e5 |

| pivot-text | Pivot text | string | percentage | | pivot-color | Pivot text background color | string | inherit progress color | | text-color | Pivot text color | string | white | | inactive | Whether to be gray | boolean | false | | show-pivot | Whether to show text | boolean | true |

Types ​

The component exports the following type definitions:

ts
importtype { ProgressProps, ProgressInstance } 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-progress-height4px-
--van-progress-colorvar(--van-primary-color)-
--van-progress-inactive-colorvar(--van-gray-5)-
--van-progress-backgroundvar(--van-gray-3)-
--van-progress-pivot-padding0 5px-
--van-progress-pivot-text-colorvar(--van-white)-
--van-progress-pivot-font-sizevar(--van-font-size-xs)-
--van-progress-pivot-line-height1.6-
--van-progress-pivot-backgroundvar(--van-primary-color)-

Enterprise-level mobile solution based on Vant