A Polymer element for star ratings
Maintained by Carlos Martinez.
Using Bower, run:
bower install star-rating
-
Import Web Components' polyfill:
<script src="//cdnjs.cloudflare.com/ajax/libs/polymer/0.1.4/platform.js"></script>
-
Import Custom Element:
<link rel="import" href="src/star-rating.html">
-
Start using it!
<star-rating></star-rating>
Basic usage:
<star-rating></star-rating>
Custom number of stars:
<star-rating stars="10"></star-rating>
Default rate selected:
<star-rating stars="10" rate="3"></star-rating>
Add your custom styles:
<star-rating stars="10" rate="3" class="custom-class"></star-rating>
Attribute | Options | Default | Description |
---|---|---|---|
stars |
number | 5 |
Number of stars |
rate |
number | 0 |
Default number of stars selected |