<Rating.Root value={4.2} count={128} />
<Rating.Input value={value} onChange={setValue} />Rating displays and accepts fractions; Rating.Input collects a whole number
from the user. Rating.ReviewItem lays out a rating with its author and comment.
API
Rating.Root
| Prop | Type | Default | |
|---|---|---|---|
value | number | required | |
count | number | — | |
max | number | MAX_STARS | |
size | RatingSize | "default" |
Plus every <div> prop. Source: rating/components/rating-root.tsx.
Rating.Input
| Prop | Type | Default | |
|---|---|---|---|
onChange | (value: number) => void | required | |
value | number | required | |
disabled | boolean | false | |
max | number | MAX_STARS | |
name | string | — | |
size | RatingSize | "default" |
Plus every <div> prop. Source: rating/components/rating-input.tsx.
Rating.ReviewItem
| Prop | Type | Default | |
|---|---|---|---|
authorName | string | required | |
rating | number | required | |
authorAvatarSrc | string | — | |
date | ReactNode | — | Pre-formatted date string (the kit stays locale-agnostic). |
Plus every <div> prop. Source: rating/components/review-item.tsx.