Leave Rating
An interactive star rating component with an animated emoji face that changes expression based on the selected rating.
Install using CLI
npx shadcn@latest add "https://obsidianui.dev/r/leave-rating.json"Install Manually
1
Install dependencies
2
Add util file
Create a file lib/utils.ts:
3
Copy the source code
Copy the code into components/ui/leave-rating.tsx
Usage
Props
| Prop Name | Type | Default | Description |
|---|---|---|---|
| question | string | "How was your experience?" | Question text |
| buttonText | string | "Submit" | Submit button text |
| onSubmit | (rating: number | false) => void | - | Callback on submit |
