Moey Icons
No results. Try “dialog”, “dark” or “grid”.
Moey extras

Rating

Stars people can pick — plain radio buttons underneath, so arrow keys, forms and validation work with no JavaScript.

Rate this product
<fieldset class="rating">
  <legend class="visually-hidden">Rate this product</legend>
  <input type="radio" name="stars" value="1" aria-label="1 star">
  <input type="radio" name="stars" value="2" aria-label="2 stars">
  <input type="radio" name="stars" value="3" aria-label="3 stars">
  <input type="radio" name="stars" value="4" aria-label="4 stars" checked>
  <input type="radio" name="stars" value="5" aria-label="5 stars">
</fieldset>

Hover to preview, click to pick. With the keyboard, Tab into it and use the arrow keys. The form sends the chosen value, and required on the first radio makes a rating mandatory.

In a review form

Your rating
<fieldset class="rating rating-lg" aria-labelledby="rating-label" data-moey-clearable>
  <input type="radio" name="rating" value="1" aria-label="1 star" required>
  …
</fieldset>

data-moey-clearable lets people click the chosen star again to clear their pick.

Showing a score

.rating-static shows any value, fractions included — for averages and listings. Give it a role="img" and a label so screen readers hear the score.

4.6(1,284 reviews)
3.5
<span class="rating-static" data-value="4.6" role="img" aria-label="4.6 out of 5"></span>

Sizes, colors & hearts

Small
Blue
Hearts
<fieldset class="rating rating-sm">…</fieldset>
<fieldset class="rating theme-blue">…</fieldset>
<fieldset class="rating rating-heart rating-lg">…</fieldset>

Ten steps, read-only and disabled

Score out of 10
Your earlier rating
Disabled
<fieldset class="rating">…10 radios…</fieldset>
<fieldset class="rating" data-readonly>…</fieldset>   <!-- shown and sent, can't be changed -->
<fieldset class="rating" disabled>…</fieldset>        <!-- not sent with the form -->
Class / attributeWhat it does
.rating (on a <fieldset>) + radiosPickable stars. Any number of radios
.rating-static + data-value="4.6"A read-only score, any fraction. data-max="10" for a 10-star scale (default 5). In your CSS: --mo-rating-value / --mo-rating-max.
.rating-sm · .rating-lg · --mo-rating-sizeSizes
theme-* · --mo-rating-color · --mo-rating-emptyColors (default amber)
.rating-heart · --mo-rating-shapeHearts, or any shape (an SVG mask)
data-moey-clearableClick the chosen star again to clear
data-readonly · disabledCan’t change it (still sent) · disabled (not sent)