Rating

Read-only star rating display. Renders filled, half-filled, and empty stars with token-driven colors and three sizes.

Example

Props

NameTypeDefaultRequiredDescription
valuenumberRequiredRating score (e.g. 3, 4.5)
maxnumber5NoTotal number of stars
size'sm' | 'md' | 'lg''md'NoStar size
labelstringNoCustom aria-label (defaults to "{value} out of {max}")

Accessibility

  • role="img" with auto-generated aria-label
  • Individual stars are aria-hidden — the container conveys meaning

Related Tokens

--rating-color-filled--rating-color-empty--rating-gap--rating-sm-size--rating-md-size--rating-lg-size