Rating
The Rating component (ui:rating) renders a multi-item rating scale with star or number modes. Each item can be rated independently.
Examples
View Glyph Markdown source
```ui:ratingtitle: Rate these featuresscale: 5mode: starlabels: low: Poor high: Excellentitems: - label: Performance description: Response time and throughput - label: Security - label: Developer Experience```Number mode
Use mode: number for a numeric scale.
Minimal
A single-item rating with no title.
Properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
title | string | No | — | Optional heading. |
scale | number | No | 5 | Number of rating points (2–10). |
mode | "star" | "number" | No | "star" | Visual mode. |
labels | { low: string; high: string } | No | — | Scale endpoint labels. |
items | RatingItem[] | Yes | — | Items to rate (min 1). |
markdown | boolean | No | false | Enable inline markdown formatting (bold, italic, links, code) in text fields. |
RatingItem
| Property | Type | Required | Description |
|---|---|---|---|
label | string | Yes | Item name. |
description | string | No | Optional description text. |
Markdown Support
Enable inline markdown formatting in item labels and descriptions:
View Glyph Markdown source
```ui:ratingtitle: Rate these featuresscale: 5mode: staritems: - label: "**Performance** & Speed" description: "Response time measured in *milliseconds*" - label: "[Security](https://example.com/security)" description: "Includes `OAuth 2.0` and **MFA**" - label: "*Developer* Experience" description: "TypeScript support and [API docs](https://example.com)"markdown: true```Supported formatting: bold, italic, code, links
Learn more about markdown in components →
Interaction events
Event kind: rating-change
| Payload field | Type | Description |
|---|---|---|
itemIndex | number | 0-based index of the rated item. |
itemLabel | string | Label of the rated item. |
value | number | The rating value. |
allRatings | Array<{ label, value }> | Full state snapshot. |
Accessibility
- Each item uses
role="radiogroup"with individualrole="radio"buttons. - Arrow keys navigate the star scale.
aria-live="polite"announces rating changes.