Rating

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.

Rating3D props

PropTypeDefaultDescription
valuenumberCurrent rating. Set it to control the component.
defaultValuenumber0Starting rating when uncontrolled.
onValueChange(value: number) => voidCalled with the new rating whenever it changes.
maxnumber5Number of stars.
sizenumber32Star size in px.
readOnlybooleanShow the rating without letting the user change it.
allowClearbooleantrueAllow clicking the chosen star to clear it.
aria-labelstring"Rating"Accessible name of the rating group.
classNamestringExtra classes added to the outer element.

More components

Guides

Start

Cards

Scenes

Controls & text

Buttons

More cards

UI elements

Form controls

App components

Text & backgrounds

Showpieces

Blocks