Skip to content

MateusZitelli/react-points-allocator

Repository files navigation

#React PointsAllocator travis

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:

React PointsAllocator

Using the component with those propos:

var PointsAllocator = require('react-points-allocator');

<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} /> 

About

A react.js component to allocate points between differents specs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published