UI Components
Rating
Star rating component with hover preview, readonly mode, and customizable max.
Quick Preview
3/5
Installation
// Copy fromsrc/components/ui/Rating.tsx
Examples
Readonly
Sizes
Out of 10
7/10
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | 0 | Current rating value |
max | number | 5 | Maximum number of stars |
onChange | (value: number) => void | - | Callback when rating changes |
readonly | boolean | - | Disable interaction |
size | 'sm' | 'md' | 'lg' | 'md' | Star size |
showValue | boolean | - | Show numeric value next to stars |
className | string | - | Additional CSS classes |