Components/Rating
Rating
Interactive star rating component with hover preview, click-to-deselect, three sizes, and custom color. Readonly mode for displaying scores.
import { Rating } from "@animui/ui"Interactive
0.0 / 5
Click to rateRead-only (display)
5.0
4.0
3.0
2.0
1.0
Sizes
sm
md
lg
In a form
Overall experience
0.0 / 5
Documentation quality
0.0 / 5
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | — | Controlled rating (float ok for readonly display). |
defaultValue | number | 0 | Uncontrolled initial rating. |
max | number | 5 | Number of stars. |
onChange | (value: number) => void | — | Called when user selects a star. |
readOnly | boolean | false | Disable interaction. |
size | "sm" | "md" | "lg" | "md" | Star size. |
color | string | "#f59e0b" | CSS color for filled stars. |
showValue | boolean | false | Show numeric value next to stars. |
label | string | — | Label shown before the stars. |