react-linear-progressbar
simple and customizable linear progress bar built using ReactJS
Installation
npm i react-linear-progressbar --save
Usage
;; { const myConfig = containerStyle :{} progressStyle:{} stripe: false animate: false showLabel: true width: 40 label: 40 + '%' return <Progressbar config = myConfig/>;}
Options
all the below configuration options (settings) should be passed as props in the form of an object named 'config' as shown in the example above.
-
containerStyle : either a css className or an object of styles. This indicates the styles for progress bar container
- Examples
- passing a css classname
<!-- style -->sampleStylebackground-color: #000 !important;<!-- config -->myConfig =containerStyle : 'sampleStyle'...- passing an object of styles
<!-- style -->const sampleStyle ='backgroundColor': '#000 !important';<!-- config -->myConfig =containerStyle : sampleStyle... -
progressStyle : similar to containerStyle property above, progressStyle is also either a css className or an object of styles. This indicates the styles for the progress bar (for example, color of the progress)
-
stripe : a boolean to specify the progress should have stripes
- possible values: true | false ; false by default
-
animate : a boolean to indicate if the the progress bar should have animation effect
- possible values: true | false ; false by default
-
showLabel : a boolean to indicate if the the progress bar percentage should be shown
- possible values: true | false ; true by default
-
width : a number which denotes the progress percentage
- possible values: any number >=0 && <=100
-
label : a string value which will display on the progress bar
- possible values: any string ; width + '%' by default
Test the code
- git clone https://github.com/yogeshkumar05/react-linear-progressbar.git
- npm install
- npm start
- launch http://localhost:3001/