Simple star-rating web component built using Easy Element.
Clicking on a star, unless the
read-only attribute is present, will fill in the appropriate number of stars and dispatch a
change event with a
detail.rating of the new rating. Clicking the same star twice clears the rating to zero.
Run the demo
See the demo page at
dist/index.class.html for how it works.
... And edit the files in the
Easy Element will rebuild your web component(s) to the
dist folder, then your browser should refresh the demo page automatically. Your terminal will report build failures due to HTML/CSS/JS syntax errors.
Note that you have two demo pages:
dist/index.class.html for new browsers, and