Re is out: see what's new Lifetime updates on every purchase Support replies within 24 hours Secure checkout via Gumroad 8,500+ sales since 2016

Star rating

Updated 2 min read 3 views

The free Star rating add-on adds a Rating field: stars visitors click, from 2 to 10. Find it under More in the field buttons.

<p>How was your visit?</p>
[[rating]]

Put it next to its question in a paragraph or a <div>, not inside a <label>: clicking the label’s text would pick the first star.

Settings

SettingWhat it does
Number of starsFrom 2 to 10. 5 by default.
Size in pixelsEach star’s width and height, from 12 to 96. 28 by default.
IconThe built-in gold star, or an SVG of yours from the Media Library. Stars not picked show faded and grey.
RequiredVisitors must pick a star. When it’s off, clicking the picked star again clears it.

Your own icon

  1. Click the field’s chip, then Choose an SVG… under Icon.
  2. Pick an SVG in the Media Library, or upload one there, and click Use this icon.
  3. To go back, click Use the built-in star.

SVG uploads stay off for the rest of your site: only files uploaded from this setting may be SVG. Each one keeps only its drawing (shapes, colors, gradients); scripts, links and embedded images are taken out. An SVG colored through a <style> block loses its colors, so export it again with the colors on the shapes.

In the rest of the form

  • Rules: a group can show or hide on the rating, such as Rating is less than 3 to ask what went wrong.
  • Mail: [rating] prints ★★★★☆ 4/5, [_raw_rating] the number alone (4).
  • Keyboard and screen readers: the stars are radio buttons underneath. Arrow keys move between them, and each is read as “4 stars of 5”.

Style it

The colors are CSS variables on .remaily-rating: --remaily-rating-on (the picked stars, #f5b400) and --remaily-rating-off (the others). To change the markup, copy templates/fields/rating/default/field.php from the add-on to your-theme/remaily/fields/rating/default/field.php.

Was this article helpful?