Rating

A star scale that works as an input or a read-only score, plus a compact badge for review counts.

tsx
import { Rating, RatingBadge } from "@pestoui/core"

Interactive

Hover, click or use the arrow keys — the stars are a roving-focus radio group.

3 of 5 stars

Read-only & fractional

readOnly swaps the buttons for a single labelled image and lets the last star fill partially.

Rating badge

For lists and cards where a full star row is too heavy. The value is always shown to one decimal.

4.8stars4.8stars(1,280)reviews4.8stars(1,280)reviews

Props

PropTypeDefaultDescription
size"sm" | "default" | "lg""default"Star box size. RatingBadge takes the same scale.
valuenumber—Controlled value. Supports fractions (4.5) when read-only. Required on RatingBadge.
defaultValuenumber0Uncontrolled starting value.
maxnumber5How many stars to render.
readOnlybooleanfalseRenders static stars with role="img" instead of an interactive radio group.
onChange(value: number) => void—Fires with the picked star value (1-based) on click or arrow key.
countnumber—RatingBadge only — review count rendered in parentheses.
localestring—RatingBadge only — locale for the count's digit grouping; the browser's own when unset. Set it on a server-rendered page, so the server's markup and the browser's first render agree.

Pesto UI · 117 documented components