Skip to content

Rating Component

Data
type: "rating"

A row of stars, hearts, circles or custom icons filled to a value — with exact/half/rounded partial fills and an optional numeric label. Perfect for reviews and scores.

Edit it — this is the actual editor panel
Design JSON
{
  "title": "Rating sample",
  "description": "A dynamic star rating",
  "dimensions": {
    "width": 800,
    "height": 420
  },
  "background": {
    "color": "#ffffff"
  },
  "components": [
    {
      "id": "sample-rating",
      "key": "score",
      "type": "rating",
      "position": {
        "x": 260,
        "y": 182
      },
      "rotation": 0,
      "size": {
        "width": 280,
        "height": 56
      },
      "dynamic": true,
      "properties": {
        "value": 4,
        "max": 5,
        "iconShape": "star",
        "activeColor": "#FBBF24",
        "inactiveColor": "#E5E7EB",
        "emptyStyle": "filled",
        "partial": "exact",
        "showValue": false,
        "valueFormat": "decimal",
        "opacity": 1
      }
    }
  ]
}

Like what you built? The full editor — canvas, templates and the render API — is free to start.

Open the editor

Rating examples

Real renders of the rating — each one is the same component with different property values, and the API payload below each preview reproduces it exactly.

App store rating badge

A 4.8-star average with the decimal score alongside, ready for a landing page.

API overrides for this example
{
  "score.value": 4.8,
  "score.showValue": true,
  "score.valueFormat": "decimal",
  "score.valueColor": "#374151"
}

Weekly CSAT report

The support team satisfaction average as green stars for a Monday Slack digest.

API overrides for this example
{
  "score.value": 4.2,
  "score.activeColor": "#10B981",
  "score.showValue": true,
  "score.valueFormat": "fraction",
  "score.valueColor": "#065F46"
}

All rating styles

Every style rendered live — each is just a different set of property values on the same component, and each has its own page with a dedicated preview, use cases and API example.

Use cases

What developers typically build with the rating component.

  • Product OG images showing the live review average
  • Testimonial cards with the customer score rendered as stars
  • App store rating badges for marketing sites
  • Weekly CSAT report images for Slack or email

Use it dynamically via the API

Set '<key>.value' to the score for each render; max, colors and border props are overridable too.

Full API request with the sample design's current values — the playground above sends only the properties you change
curl --location 'https://render.imejis.io/v1/{{YOUR_DESIGN_ID}}' \
--header 'dma-api-key: {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
    "score.value": 4,
    "score.max": 5,
    "score.iconShape": "star",
    "score.activeColor": "#FBBF24",
    "score.inactiveColor": "#E5E7EB",
    "score.emptyStyle": "filled",
    "score.partial": "exact",
    "score.showValue": false,
    "score.valueFormat": "decimal",
    "score.opacity": 1
}'

Only send the properties you want to change — everything else keeps its design value. See the API documentation for all languages.

Property reference

Every property the rating component accepts — in the editor, in design JSON, and as API overrides.

PropertyTypeEdits asDefaultDescription
valuenumber33Current rating value (supports fractions).
maxnumber55Total number of icons.
iconShape'star' | 'heart' | 'circle' | 'custom'starheartcirclecustom"star"Icon used for each rating unit.
customPathstringtext—SVG path for the icon when iconShape is 'custom'.
customEmojistringtext—Emoji used as the icon when iconShape is 'custom'.
activeColorcolor#FBBF24"#FBBF24"Color of filled (active) icons.
inactiveColorcolor#E5E7EB"#E5E7EB"Color of unfilled (inactive) icons.
emptyStyle'filled' | 'outline'filledoutline"filled"Whether empty icons render solid in the inactive color or as outlines.
partial'exact' | 'half' | 'round'exacthalfround"exact"How fractional values fill the last icon.
showValuebooleanfalsefalseShow the numeric value next to the icons.
valueFormat'decimal' | 'fraction' | 'countOfTotal'decimalfractioncountOfTotal"decimal"Format of the numeric label (4.5, 4.5/5, or "4 of 5").
valueColorcolor#374151"#374151"Color of the numeric label.
perRownumber00Icons per row before wrapping (0 = single row).
opacitynumber11Overall component opacity from 0 (transparent) to 1 (opaque).
borderWidthnumber00Border thickness in pixels around the component.
borderColorcolortransparent"transparent"Border color (any CSS color).
borderStyle'solid' | 'dashed' | 'dotted' | 'double' | 'none'soliddasheddotteddoublenone"solid"Border line style.
borderRadiusnumber00Corner radius in pixels.
boxShadowstringtext—CSS box-shadow applied to the component, e.g. "0 4px 6px rgba(0,0,0,0.1)".

Frequently asked questions

Yes — send '<key>.value' with any number, including fractions like 4.3; max, colors and other properties are overridable too.

The partial property controls the last icon: 'exact' fills it proportionally, 'half' rounds to halves and 'round' rounds to a whole icon.

iconShape supports star, heart, circle or custom — with customEmoji for any emoji or customPath for your own SVG path.

Enable showValue and pick a valueFormat — decimal (4.5), fraction (4.5/5) or countOfTotal ("4 of 5") — with valueColor for styling.

We use cookies to run the site and, depending on your region and your choice here, for analytics and marketing. See our Cookie Policy. You can change this any time from “Cookie settings” in the footer.