Simple React.js component to distribute a limited number of points between options.
Install
$ npm install react-points-allocator --save-dev
Build
For a production version (minified):
$ npm run build
Or for development (unminified and with source-maps):
$ npm run dev-build
Usage
Generate an allocator like this:
Using the component with those propos:
var PointsAllocator = ; <PointsAllocator // The total number of available points points=100 // The options texts options='Study' 'Work' 'Sleep' // { Optional | Default: Array of zeroes } // Initial value of the range related with each option initialRanges=40 40 0 // { Optional | Default: points } // The maximum value of the ranges rangesSize=50 />