Star Rating Component

Getting Started

To use the star rating component, add the following to the head section of your HTML file.

<script src="https://emmajwang.github.io/star-rating/src/StarRating.js" type="module"></script>

Attributes

rating

The rating is the number of symbols that will appear. Decimals are not allowed.

If rating is larger than outof, then upon display rating will be overridden to the maximum number of stars (outof stars).

outof

The number of symbols that the rating is out of.

If emoji is specified, then outof will have no effect. If emoji is not specified, then outof minus rating empty stars will be displayed after the shaded stars that represent the rating.

emoji

The symbol used to represent the rating. emoji can be any Unicode character.