Rating Stars
v0.0.0A read-only star rating. Fractional values are drawn with a clipped fill rather than rounded to a half, so 4.3 and 4.7 look different. The stars are decorative — the value is announced once through an `aria-label`.
A read-only star rating. Fractional values are drawn with a clipped fill
rather than rounded to a half, so 4.3 and 4.7 look different. The stars are
decorative — the value is announced once through an aria-label.
Usage
Scale
max sets the number of stars; value is on the same scale.
Sizes
Compositions
Open all 4 →Properties
RatingStars props
| Prop | Type | Default | Description |
|---|---|---|---|
value* | number | — | The rating to show, from 0 to `max`; fractions render as partially filled stars |
className | string | — | Additional class names to merge with the component root element |
count | number | — | Optional review count shown after the stars, e.g. "(128)" |
max | number | 5 | Number of stars; defaults to 5 |
size | "sm" | "md" | "lg" | md | Controls the star size; defaults to md |
Also accepts the native attributes of its root element (className, aria-*, event handlers, …).