Skip to content

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:rating
title: Rate these features
scale: 5
mode: star
labels:
low: Poor
high: Excellent
items:
- 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

PropertyTypeRequiredDefaultDescription
titlestringNoOptional heading.
scalenumberNo5Number of rating points (2–10).
mode"star" | "number"No"star"Visual mode.
labels{ low: string; high: string }NoScale endpoint labels.
itemsRatingItem[]YesItems to rate (min 1).
markdownbooleanNofalseEnable inline markdown formatting (bold, italic, links, code) in text fields.

RatingItem

PropertyTypeRequiredDescription
labelstringYesItem name.
descriptionstringNoOptional description text.

Markdown Support

Enable inline markdown formatting in item labels and descriptions:

View Glyph Markdown source
```ui:rating
title: Rate these features
scale: 5
mode: star
items:
- 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 fieldTypeDescription
itemIndexnumber0-based index of the rated item.
itemLabelstringLabel of the rated item.
valuenumberThe rating value.
allRatingsArray<{ label, value }>Full state snapshot.

Accessibility

  • Each item uses role="radiogroup" with individual role="radio" buttons.
  • Arrow keys navigate the star scale.
  • aria-live="polite" announces rating changes.