shadcn.io is an independent project built on shadcn/ui
Rate Experience opens How was your experience? Five stars sit under Rating, and none are filled, so Submit Rating is off. An optional comment field is under the stars, with Cancel beside the button.
Use it for a quick score plus an optional note. Ask for the score alone in a Popover if a dialog is too heavy. In Svelte, Ark UI does not store the rating.
Installation
Anatomy

Usage
<Dialog><DialogTrigger>{#snippet asChild(props)}<Button {...props()} variant="outline">Rate Experience</Button>{/snippet}</DialogTrigger><DialogContent class="sm:max-w-lg"><DialogHeader><DialogTitle>How was your experience?</DialogTitle><DialogDescription>Please rate your experience and share any additional feedback.</DialogDescription></DialogHeader><FieldGroup><Field><FieldLabel>Rating</FieldLabel><Rating class="**:data-[slot=rating-item-indicator]:size-8" name="rating" onValueChange={handleValueChange} value={rating} /></Field><Field><FieldLabel>Additional feedback (optional)</FieldLabel><Textarea class="min-h-25" name="comment" placeholder="Tell us more about your experience..." /></Field></FieldGroup><DialogFooter><DialogClose>{#snippet asChild(props)}<Button {...props()} variant="outline">Cancel</Button>{/snippet}</DialogClose><Button disabled={rating === 0}>Submit Rating</Button></DialogFooter></DialogContent></Dialog>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.
API Reference
Dialog
No extra props in this demo. The rest is on the Dialog page.
Button
Sets props, variant="outline" and disabled={rating === 0}. The rest is on the Button page.
Field
No extra props in this demo. The rest is on the Field page.
Rating
Sets name="rating", onValueChange={handleValueChange} and value={rating}. The rest is on the Rating page.
Textarea
Sets name="comment" and placeholder="Tell us more about your experience...". The rest is on the Textarea page.





