react-points-allocator

0.1.3 • Public • Published

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

Package Sidebar

Install

npm i react-points-allocator

Weekly Downloads

0

Version

0.1.3

License

MIT

Last publish

Collaborators

  • mzitelli