Rating Overview shows an aggregate rating summary with a distribution bar and configurable label placement.
Loading demo: rating-overview-real-world
npx sdaia-ui@latest add rating-overview
import { RatingOverview } from '@/components/ui/RatingOverview';<RatingOverview labelPlacement="top-left" />The default rating overview with top-left label placement.
Loading demo: rating-overview-default
Stacked rating overview displaying a full breakdown of scores per star level.
Loading demo: rating-overview-stacked
Props for the RatingOverview component.
Prop | Type | Default | Required |
|---|---|---|---|
value | number | 3.5 | optional |
max | number | 5 | optional |
label | ReactNode | - | optional |
labelPlacement | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'start' | 'end' | 'top-left' | optional |
stacked | boolean | false | optional |
showHelperText | boolean | true | optional |
helperText | string | "123 ratings" | optional |
starStyle | 'solid' | 'outline' | 'solid' | optional |
direction | 'ltr' | 'rtl' | 'ltr' | optional |
starSize | number | 24 | optional |
labels | Partial<RatingOverviewLabels> | English strings | optional |
How this component behaves at the three system breakpoints. Spacing and type tokens switch automatically at 768px and 1280px.
| Screen | Behavior |
|---|---|
| Desktop (1280px and up) | Score, stars and helper text stacked in a column, sized by their content. |
| Tablet (768–1279px) | Same layout as desktop, with the tablet token values. |
| Phone (under 768px) | Same layout with the mobile token values (smaller score and text). The score line wraps if it doesn't fit. |