Rating
Forms & Input

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.

RatingProps props
PropTypeDefaultDescription
valuenumber—Numeric rating. Supports fractional values.
maxnumber5Number of symbols.
sizenumber12Star size in px.
labelReactNode—Dim trailing text (e.g. '4.6 · 218 reviews').
colorstringvar(--m-color-warn)Star fill color. Accepts any CSS color.

Examples

Values

Rating values

With label

Rating with label

Custom color

Rating with custom color

Size

Rating sizes
ImportTSX
import { Rating } from "@solarius/onset";
import type { RatingProps } from "@solarius/onset";