Skip to content
This repository has been archived by the owner on Jan 30, 2018. It is now read-only.

monstercat/rating

Repository files navigation

rating

Rating component with SVG stars demo

Installation

$ component install monstercat/rating

Example

var rating = require('rating');
var rate = rating({ stars: 10 });
var container = document.querySelector('.example');

rate.attach(container);
rate.disable();
rate.enable();
rate.rate(5);
rate.set([1,3,4,6]);
rate.on('rating', function(rating){
  console.log(rating);
});

Adjust star size

.star {
  // defaults
  height: 16px;
  width: 16px;
}

License

MIT