1.1.3 • Published 5 years ago

angular-svg-progress v1.1.3

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

https://badgen.net/bundlephobia/minzip/angular-svg-progress 1.7 min zipped lightweight progress bar

Angular SVG Progress

SVG Progress component for angular and ionic framework consist of bar, heart and circular loaders.

Appearance

Features

  • Each loader component is an svg.
  • Consist of bar, heart and circular loaders.
  • Can be scaled to any size.
  • customize color, size, value, border-radius, direction.

Installation

1. Install the NPM Package

npm install --save angular-svg-progress

2. Import AngularSvgProgressModule module

Add AngularSvgProgressModule in your app's root module

import { AngularSvgProgressModule } from 'angular-svg-progress';

// import the module
@NgModule({
  ...
  imports: [
    AngularSvgProgressModule
  ]
})
export class AppModule {}

For Lazy Loaded Components add AngularSvgProgressModule in your child/shared module(s)

import { AngularSvgProgressModule } from 'angular-svg-progress';

@NgModule({
  ...
  imports: [
    AngularSvgProgressModule
  ]
})
export class SharedModule {}

Usage

Basic Usage

This HTML code demonstrates basic usage of this module:

<angular-svg-progress
  [svgProgress]="Progress"
  style="margin-bottom: 25px;"
  [width]="500"
  [shape]="'rectangle'"
  [borderColor]="'#383a3e'"
  [direction]="'horizontal'"
  [showMiddleText]="true"
  [middleTextStyle]="{textSize: 12,fontWeight: 400}"
  [showPercentage]="true"
  [height]="40"
  [progressColor]="'#FF0000'">
</angular-svg-progress>

Advanced Usage

The <angular-svg-progress /> component takes many attributes that allows you to customize the progress. You can use the following table as a reference:

Attribute NameTypeDescriptionDefault Value
shapestringShape of progress component. bar, heart, circlerectangle
widthnumberTotal width in numbers(pixel)100
heightnumberTotal height in numbers(pixel)100
svgProgressnumberDynamic progress value(in percentage)NA
progressColorstringColor of the progress indicatorred
borderColorstringColor of the svg progress component borderblack
showPercentagebooleanTo show the progress valuefalse
percentageColorstringProgress value text colorblack
showMiddleTextbooleanTo show static text in the middle of the loaderfalse
middleTextstring /numberstatic/dynamic text in the middle of the loaderNA
middleTextStyleObject of type{textSize:number,fillColor:string,fontWeight:number/string}style object for static text in the middle of the loadernull
directionstringDirection in which progress indicator grows. horizontal,verticalhorizontal
backgroundFillstringbackground color of the component svg#eee8dc
fontSizenumberFont size of the progress value text(pixel)15
borderRadiusnumberBorder radius for the svg component only for shape bar10
radiusnumberRadius of the circular progress50
circleWidthnumberWidth of the circular disk15

Support this project

If you find this project useful, please star the repo to let people know that it's reliable. Also, share it with friends and colleagues that might find this useful as well. Thank you :smile: