Rating
Ready
Star rating input with multiple variants and half-value support
Interactive Preview
Click the stars to rate
Variants
Three icon variants: star, heart, and thumbs
Star (default)
Heart
Thumbs Up
Sizes
Four size options: sm, md, lg, and xl
Small
Medium (default)
Large
Extra Large
Half Rating
Allow half-star ratings with precise control
Current value: 3.5
States
Different states for various use cases
Read Only
Disabled
With Error
Custom Colors
Override default colors with custom ones
Green Theme
Purple Theme
Custom Maximum
Change the maximum rating value
10 Stars
3 Hearts
Usage
How to use the Rating component
// Basic rating
<Rating value={rating} onChange={setRating} />
// With label and value display
<Rating
label="Rate this product"
value={rating}
onChange={setRating}
showValue
size="lg"
/>
// Half-star rating
<Rating
value={rating}
onChange={setRating}
allowHalf
variant="heart"
/>
API Reference
Props
value-number - Current rating valueonChange-(value: number) => void - Callback when rating changesmax-number - Maximum rating value (default: 5)size-"sm" | "md" | "lg" | "xl" (default: "md")variant-"star" | "heart" | "thumbs" (default: "star")allowHalf-boolean - Allow half-value selection (default: false)showValue-boolean - Display numeric value (default: false)disabled-boolean - Disable interaction (default: false)readOnly-boolean - Make read-only (default: false)label-string - Label texterror-string - Error messagehelperText-string - Helper textemptyColor-string - Custom empty state color (Tailwind class)fillColor-string - Custom fill color (Tailwind class)hoverColor-string - Custom hover color (Tailwind class)