> For the complete documentation index, see [llms.txt](https://docs.roadmap.so/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roadmap.so/reviews/storefront-and-display/edit-your-review-badge.md).

# Edit your review badge

Configure the compact star rating and review count you show on product cards and listings.

The review badge is the compact star rating and review count you place on product cards, collection pages and anywhere else you want a rating at a glance. You edit it in the review widget editor, with **Review Badge** selected in the widget dropdown.

For the editor itself, the preview and how saving works, see [Customise review widget design](https://docs.roadmap.so/reviews/storefront-and-display/customise-review-widget-design.md).

<figure><img src="https://393112916-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ8asLD4FVCFagK40xEr4%2Fuploads%2FJtit8eNGmh4oAXRalvLf%2FScreenshot%202026-10-20%20at%2012.40.58%E2%80%AFPM.png?alt=media&amp;token=4d3bda04-9330-4d20-95bf-1ad951ba05cc" alt="" width="563"><figcaption></figcaption></figure>

### Review Badge Settings

**The stars**

* **Star display**, which controls whether the badge shows the full rating, the stars alone, or stars with text.
* **Alignment**, **Star style**, **Star size (px)** and **Star colour**.

**The text beside the stars**

* **Show text** turns the text on or off.
* **Text** is the text itself, and accepts variables.
* **Font size (px)**, **Font weight** and **Font colour**.

**Behaviour**

* **Hide when there are no reviews**, so a product with no reviews shows nothing rather than an empty rating. This is on by default and worth leaving on, because an empty rating reads as a bad rating.
* **Link to reviews section**, which makes the badge clickable and scrolls the shopper down to the reviews.

### The text variables

The **Text** field accepts these variables. They are listed under the field in the editor, and you can click a snippet to add it:

| Variable                         | What it renders                                                       |
| -------------------------------- | --------------------------------------------------------------------- |
| `{{ average_rating_1_decimal }}` | The average rating, to one decimal place.                             |
| `{{ average_rating }}`           | The average rating, to two decimal places.                            |
| `{{ n }}`                        | The review count: reviews with a star rating.                         |
| `{{ total_n }}`                  | The total review count, including reviews left without a star rating. |

The default is:

```
{{ average_rating_1_decimal }} ({{ n }} reviews)
```

which renders as `4.3 (128 reviews)`.

You can write whatever reads best for your store. `{{ n }} reviews` alone drops the number, and `Rated {{ average_rating_1_decimal }} by {{ n }} customers` turns the badge into a sentence.

{% hint style="info" %}
If some of your reviews have no star rating, use `{{ n }}` and `{{ total_n }}` together, for example `({{ n }} ratings, {{ total_n }} reviews)`. See [Count only rated reviews in star averages](https://docs.roadmap.so/reviews/storefront-and-display/count-only-rated-reviews-in-star-averages.md).
{% endhint %}

### Related guides

* [Customise review widget design](https://docs.roadmap.so/reviews/storefront-and-display/customise-review-widget-design.md)
* [Edit your PDP review block](https://docs.roadmap.so/reviews/storefront-and-display/edit-your-pdp-review-block.md)
* [Add reviews to product pages](https://docs.roadmap.so/reviews/storefront-and-display/add-reviews-to-product-pages.md)
* [Count only rated reviews in star averages](https://docs.roadmap.so/reviews/storefront-and-display/count-only-rated-reviews-in-star-averages.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.roadmap.so/reviews/storefront-and-display/edit-your-review-badge.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
