1.0.2 • Published 2 years ago

multi-color-gradient-progressbar-with-indicator v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

multi-color-gradient-progressbar-with-indicator

multiple color gradient progressbar with indicator

NPM JavaScript Style Guide

Appearance

Install

npm install --save multi-color-gradient-progressbar-with-indicator

Usage

import React, { Component } from 'react'

import MultiColorProgressbar from 'multi-color-gradient-progressbar-with-indicator'
import 'multi-color-progressbar-with-indicator/dist/index.css'

class Example extends Component {
  render() {
    var bars = [
      {width: 40, color: '#dc3545'},
      {width: 15, color: '#d5873d'},
      {width: 15, color: '#f2d261'},
      {width: 15, color: '#9baa4b'},
      {width: 15, color: '#6fa053'}
    ]
    let wrapper = {
      padding: '30px'
    }
    return (
      <div style={{width: '50%', margin: '0 auto', paddingTop: '10%'}}>
        <div style={wrapper}>
          <MultiColorProgressbar height={30} bars={bars} minVal={0} maxVal={1000} value={650} />
        </div>
        <div style={wrapper}>
          <MultiColorProgressbar height={30} bars={bars} minVal={0} maxVal={1000} value={780} />
        </div>
        <div style={wrapper}>
          <MultiColorProgressbar height={30} bars={bars} minVal={0} maxVal={1000} value={350} />
        </div>
      </div>
    )
  }
}

Properties

PropDataTypeDescriptionDefault
heightnumberheight of progress bar (in pixel)10
colorstringdefault color of progress bar'#007bff'
barsarray of Objectsarray of progress objects (width and color){width: 100}
minValnumbermin value of multiple progress bar0
maxValnumbermax value of multiple progress bar100
valuenumbervalue of multiple progress bar0
fontSizenumberfont size of step values (in pixel)15
indicatorVisibleboolshow/hide indicatortrue
stepValuesVisibleboolshow/hide step valuestrue

License

MIT © misil4