YYonda UI Docs

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

PropTypeDefaultDescription
valuenumberrequiredRating 0–5, may be fractional (read-only) or integer (interactive)
size"sm" | "md" | "lg""md"Star size
classNamestring—Extra classes on the wrapper
showValuebooleanfalse(Read-only) Show numeric value after stars
reviewCountnumber—(Read-only) Show review count in parentheses
interactivebooleanfalseEnable click + keyboard input
onChange(value: number) => voidrequired if interactiveFires with the new integer rating
disabledbooleanfalse(Interactive) Disable clicks
aria-labelstringauto(Interactive) Group label