> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.templated.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Rating Stars and Reviews

# Rating Stars and Reviews

Add dynamic star ratings to your templates.

## Adding Rating Layers

### In Editor
1. Click **Rating** in the sidebar
2. A rating layer is added to your canvas
3. Configure:
* **Shape** — Star, heart, diamond, circle, square
* **Max Rating** — Total number of symbols (default 5)
* **Default Rating** — Initial value
* **Colors** — Filled, empty, and border colors
* **Spacing** — Gap between symbols

## Via API

Set the rating value dynamically:

```json
{
  "layers": {
    "review-stars": {
      "rating": 4.5
    }
  }
}
```

## Properties

| Property | Type | Description |
| ---- |
| `rating` | number | The rating value (e.g., 4.5) |
| `rating_shape` | string | Shape type |
| `fill` | string | Filled color (hex) |
| `background` | string | Empty/unfilled color |
| `stroke` | string | Border color |

## Available Shapes

* `star` — Classic 5-point star (default)
* `heart` — Heart shape
* `diamond` — Diamond shape
* `circle` — Filled circles
* `square` — Filled squares

## Example: Product Review

```json
{
  "template": "PRODUCT_TEMPLATE",
  "layers": {
    "product-name": { "text": "Wireless Headphones" },
    "product-image": { "image_url": "https://..." },
    "rating": { "rating": 4.7 },
    "review-count": { "text": "(2,847 reviews)" }
  }
}
```

## Partial Ratings

Ratings support decimal values:
* `4.0` — 4 full stars
* `4.5` — 4.5 stars (half-filled)
* `4.7` — 4.7 stars (70% of 5th star filled)

## Use Cases

* Product review displays
* Customer testimonials
* Service quality indicators
* Feedback forms
* Restaurant/hotel ratings