A circular progressbar component for Vue 3, built with SVG and extensively customizable
npm install vue3-circle-progressHighly customizable & lightweight circular progressbar component for Vue 3, built with SVG and extensively customizable.
* Installation
* Usage and Examples
* Props
* Gradient (props.gradient)
* Shadow (props.shadow)
* Callback
* Default Props
#### Live demo: codesandbox.io/s/determined-dawn-3ybev
Install with npm:
```
npm install --save vue3-circle-progress
or yarn:
``
yarn add vue3-circle-progress
`vue
// Basic Usage
// Default Gradient
// Customize Gradient
:gradient="{
angle: 90,
startColor: '#ff0000',
stopColor: '#ffff00'
}"
/>
// Default Shadow
// Customize Shadow
:bg-shadow="{
inset: true,
vertical: 2,
horizontal: 2,
blur: 4,
opacity: .4,
color: '#000000'
}"
empty-color="#f7f7f7"
:border-width="6"
:border-bg-width="30"
/>
import "vue3-circle-progress/dist/circle-progress.css";
import CircleProgress from "vue3-circle-progress";
export default {
components: {CircleProgress}
}
`
Available Props, this package supports 30+ props
| Names | Description | Default Value | Type | Range/Max
| ------ | ------ | ------ | ------ | ------ |
| size | Circle height & Width | 180 | Int | ∞ |15
| border-width | Circle Border width | | Int | ∞ |15
| border-bg-width | Circle Border Background width | | Int | ∞ |#288feb
| fill-color | Stroke Fill Color | | String | N/A |#288feb
| empty-color | Stroke (empty) BG Fill Color | | String | N/A |none
| background | Circle Background | | String | N/A |''
| class | Component Custom Class | | String | N/A |55
| percent | Fill Percent | | Int | 100 |round
| linecap | Stroke Line Style | | String | N/A |false
| is-gradient | Enable Gradient | | Boolean | N/A |200
| transition | Apply transition when percent change | (ms) | Int | ∞ |false
| gradient | Gradient Essential Values | {...} | Object | N/A |
| is-shadow | Enable Circle Shadow | | Boolean | N/A |false
| shadow | Shadow Essential Values | {...} | Object | N/A |
| is-bg-shadow | Enable Circle BG Shadow | | Boolean | N/A |true
| bg-shadow | Shadow Essential Values | {...} | Object | N/A |
| viewport | Animate when element is in viewport | | Boolean | N/A |undefined
| on-viewport | Callback function to detect viewport | | Function | N/A |false
| show-percent | Enable disable percent counter | | Boolean | N/A |
#### Example:
`vue
:bg-shadow="{
inset: true,
vertical: 2,
horizontal: 2,
blur: 4,
opacity: .4,
color: '#000000'
}"
empty-color="#f7f7f7"
:border-width="6"
:border-bg-width="30"
/>
import CircleProgress from "vue3-circle-progress";
export default {
components: {CircleProgress}
}
`
| Names | Description | Default Value | Type | Range/Max
| ------ | ------ | ------ | ------ | ------ |
| angle | Gradinet Angle | 0 | Int | 0-360 |#ff0000
| startColor | Gradient Start Color | | String | N/A |#ffff00
| stopColor | Gradient Stop Color | | String | N/A |
#### Example:
`vue`
:gradient="{
angle: 90,
startColor: '#ff0000',
stopColor: '#ffff00'
}"
/>
| Names | Description | Default Value | Type | Range/Max
| ------ | ------ | ------ | ------ | ------ |
| inset | Set Shadow Inset or Outset | false | Boolean | N/A |3
| vertical | Shadow Vertical Offset | | Int | ∞ |0
| horizontal | Shadow Horizontal Offset | | Int | ∞ |0
| blur | Shadow Blur | | Int | ∞ |.4
| opacity | Shadow Opacity | | Float | 0-1 |#000000
| color | Shadow Color | | String | 0-1 |
#### Example
`vue
:shadow="{
inset: true,
vertical: 2,
horizontal: 2,
blur: 4,
opacity: .4,
color: '#000000'
}"
/>
`
| Names | Description | Default Value | Type | Range/Max
| ------ | ------ | ------ | ------ | ------ |
| inset | Set Shadow Inset or Outset | false | Boolean | N/A |3
| vertical | Shadow Vertical Offset | | Int | ∞ |0
| horizontal | Shadow Horizontal Offset | | Int | ∞ |0
| blur | Shadow Blur | | Int | ∞ |.4
| opacity | Shadow Opacity | | Float | 0-1 |#000000
| color | Shadow Color | | String | 0-1 |
#### Example
`vue
:bg-shadow="{
inset: true,
vertical: 2,
horizontal: 2,
blur: 4,
opacity: .4,
color: '#000000'
}"
/>
`
This callback function fires when the target element is in the viewport.
`vue``
// do something
}"
/>