react-round-trip-rate

Renders a button that allows ratings from 0 to n

Usage no npm install needed!

<script type="module">
  import reactRoundTripRate from 'https://cdn.skypack.dev/react-round-trip-rate';
</script>

README

React-Round-Trip-Rate

SemVer License Build Status

A react component that renders a button that, if clicked repeatedly changes state according to steps(default 3, for example for min, normal and max).

Demo

Install

Install as node dependency:

npm install react-round-trip-rate --save

Quickstart

npm start & npm run watch

Commands

  • npm run build - build production css and js
  • npm run watch - compile css and js
  • npm run watch:test - run tests on change
  • npm start - start static dev server
  • npm test - run lint and tests

Usage


var React = require('react');
var roundTripRate = require('react-round-trip-rate');

React.createElement(roundTripRate, {
  steps: 3, // steps as in good, very good, excellent
  label: 'Java skill', // the name of what is being rated. In this case Java skill
  cssClass: 'rating'
}));

Properties

  • label: button label
  • steps: number of rating steps
  • cssClass: css class to apply to the button

License

MIT