Rating
Read-only star display with fractional fills. The filled layer clips per-star so 4.3 shows a partly-filled fourth star rather than rounding.
Props
Rating extends HTMLAttributes<HTMLDivElement>. Renders as role="img" with an accessible label.
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | — | Numeric rating. Supports fractional values. |
max | number | 5 | Number of symbols. |
size | number | 12 | Star size in px. |
label | ReactNode | — | Dim trailing text (e.g. '4.6 · 218 reviews'). |
color | string | var(--m-color-warn) | Star fill color. Accepts any CSS color. |
Examples
Values
With label
Custom color
Size
import { Rating } from "@solarius/onset";
import type { RatingProps } from "@solarius/onset";