StarRating
Canonical 5-star rating display supporting fractional fills. Read-only variant for property cards + review aggregates; interactive variant for review submission with keyboard support.
Sizes
Three sizes — sm for property tiles, md default, lg for detail-page aggregates.
sm
md
lg
Fractional fills
Partial-star fills use an SVG clipPath so 4.5 shows exactly half of the 5th star.
0
1
2.5
3.75
4.5
5
With numeric value + review count
Combine with showValue and reviewCount for the aggregate summary shown on detail pages.
4.54.7(1,234 reviews)5.0(1 review)(87 reviews)
Interactive (review submission)
Set interactive to enable click + keyboard input. Uses role="radiogroup" for accessibility. Only accepts integer ratings 1–5.
Current rating: 0
Disabled
Disabled — clicks are ignored.
Props reference
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | required | Rating 0–5, may be fractional (read-only) or integer (interactive) |
| size | "sm" | "md" | "lg" | "md" | Star size |
| className | string | — | Extra classes on the wrapper |
| showValue | boolean | false | (Read-only) Show numeric value after stars |
| reviewCount | number | — | (Read-only) Show review count in parentheses |
| interactive | boolean | false | Enable click + keyboard input |
| onChange | (value: number) => void | required if interactive | Fires with the new integer rating |
| disabled | boolean | false | (Interactive) Disable clicks |
| aria-label | string | auto | (Interactive) Group label |