A generic React component which renders a responsive and slick progress bar. It provides 4 type of progress bars with options to customize them accordingly.
A generic React component which renders a responsive and slick progress bars. It provides 4 type of progress bars with options to customize them accordingly.
npm i pretty-progressbar --save-dev
or
npm install pretty-progressbar --save-dev
import React from 'react';
import { render } from 'react-dom';
import PrettyProgressbar from 'pretty-progressbar';
class App extends React.Component {
render() {
return (
<PrettyProgressbar
percentage="41"
type='default'
label={true}/>
)
}
}
render(
<App/>, document.getElementById('root')
)
import React from 'react';
import { render } from 'react-dom';
import PrettyProgressbar from 'pretty-progressbar';
class App extends React.Component {
render() {
let progressBarStyle = {
'display' : 'inline-block',
'margin' : '9px'
}
let progressStyle = {
'background' : 'indianred'
}
return (
<PrettyProgressbar
percentage="81"
type='circle'
label={true}
progressbarStyle={progressBarStyle}
progressStyle={progressStyle}/>
)
}
}
render(
<App/>, document.getElementById('root')
)
Name | Required | Type | Description |
---|---|---|---|
percentage |
Yes | number | Progress from 0 to 100. Default 0 |
label |
No | boolean | Which shows percentage on the progress bar (true/false) - Default false |
type |
No | string | Which defines type of progress bar (default/circle/cyclinder/square) - Default |
progressbarStyle |
No | object | Style object for the progressbar wrapper (container) |
progressStyle |
No | object | Style object for the progress (content) |
Krishcdbry (krishcdbry@gmail.com)
Click here @https://krishcdbry.github.io/pretty-progressbar/demo/
MIT @krishcdbry