Glossy stars that preview on hover and pop in order when chosen. Use it to collect a rating, or read-only to show one.
Install it the shadcn way: copy the source file into your project. It uses CSS 3D, Tailwind CSS v4 and Framer Motion, no WebGL.
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | Current rating. Set it to control the component. | |
| defaultValue | number | 0 | Starting rating when uncontrolled. |
| onValueChange | (value: number) => void | Called with the new rating whenever it changes. | |
| max | number | 5 | Number of stars. |
| size | number | 32 | Star size in px. |
| readOnly | boolean | Show the rating without letting the user change it. | |
| allowClear | boolean | true | Allow clicking the chosen star to clear it. |
| aria-label | string | "Rating" | Accessible name of the rating group. |
| className | string | Extra classes added to the outer element. |