shadcn.io is not affiliated with official shadcn/ui
Dialog examples · Standard
Rating Dialog for React
A rating dialog with a five-star rating, an optional comment and a Submit button that waits for a rating.
A quick rating tells you a lot. This React dialog asks for one to five stars and an optional comment, and keeps Submit Rating disabled until a star is picked. It's shadcn.io's Dialog on Base UI with the Rating component and a Textarea.
Preview
Installation
FAQ
Does the rating preview on hover?
Yes. Rating highlights the stars under the pointer before a click and handles the arrow keys, so there's no hover state to manage.
How is the rating stored?
The rating is controlled: onValueChange passes the new value, and Submit Rating takes disabled while it's 0.
How are the stars made larger?
The stars use the theme's warning color, and a class on Rating sets their size: **:data-[slot=rating-item-indicator]:size-8.
Related
- Feedback DialogA feedback dialog with one labeled
- Standard DialogA share dialog with a read-only link, a
- Button with Text (Standard)The one filled action
- Simple TextareaA plain textarea with a placeholder and
- Newsletter DialogA newsletter dialog with one email field
- Badge with Text (Standard)A default badge with a short label for a