Skip to content

Circle Progress Bar 0.1.19

A circular progress bar component that supports progress gradient animation.

Basic Usage

Use v-model to represent the current progress of the progress bar, and the text property controls the text content in the middle of the progress bar.

html
<wd-circle v-model="current" :text="`Progress: ${current}%`"></wd-circle>
ts
const current = ref<number>(10)

Width Control

Use the strokeWidth property to control the width of the progress bar, default is 10px.

html
<wd-circle v-model="current" :strokeWidth="15"></wd-circle>

Color Customization

Use the color property to control the progress bar color, default is #1C64FD, and use the layerColor property to control the progress bar track color, default is #EBEEF5.

html
<wd-circle v-model="current" color="#1C64FD" layer-color="#EBEEF5"></wd-circle>

Gradient Color

The color property supports passing an object format to define gradient colors.

html
<wd-circle v-model="current" :color="gradientColor"></wd-circle>
ts
const gradientColor = {
  '0%': '#ffd01e',
  '100%': '#ee0a24'
}

Progress Bar Direction

Use the clockwise property to control the direction of the progress bar. When clockwise is false, the progress will start from the counterclockwise direction.

html
<wd-circle v-model="current" :clockwise="false"></wd-circle>

Size Customization

Use the size property to control the diameter of the progress bar circle, default is 100px.

html
<wd-circle v-model="current" :size="300"></wd-circle>

Attributes

ParameterDescriptionTypeOptionsDefaultVersion
v-model / modelValueCurrent progressnumber-00.1.19
customClassCustom classstring--0.1.19
customStyleCustom stylestring--0.1.19
sizeCircle diameter, default unit is pxnumber-1000.1.19
colorProgress bar colorstring / Record<string, string>-#4d80f00.1.19
layerColorTrack colorstring-#EBEEF50.1.19
fillFill colorstring-#ffffff0.1.19
speedAnimation speed (unit: rate/s)number-500.1.19
textText contentstring--0.1.19
strokeWidthProgress bar width, unit pxnumber-100.1.19
strokeLinecapShape of progress bar endpointsstringbutt / round / squareround0.1.19
clockwiseWhether to increase clockwiseboolean-true0.1.19

External Classes

Class NameDescriptionVersion
custom-classRoot node style-

Source Code

Documentation
Component

Released under the MIT License.

Released under the MIT License.