1.0.2 • Published 6 years ago

multicolorslider v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

multicolorslider

Multi-color slider implemented in ReactJS. Configurable number of segments and colors!

Install

npm i multicolorslider

Run locally

To run the example App locally:

npm install
npm run build
npm start

Open localhost:2222.

Usage

import ColorSlider from 'multicolorslider'
<ColorSlider
  min={Number}
  max={Number}
  name={String}
  thresholds={Array}
  colors={Array}
  onChange={Function}
/>

Props

PropTypeDefaultDescription
minnumberminimum value on the slider
maxnumbermaximum value on the slider
namestringname of the slider
thresholdsarray[]array of thresholds with array 0 == min and arraylength -1 == max
colorsarray[]array of color codes, each representing a color segment on the slider in a sequence. The array length is equal to the thresholds array length - 1
onChangefunctioncall back function whenever slider changes a value/threshold

License

Please check the LICENSE file.