Star Rating
Display star ratings with half-star support and configurable sizes.
Installation
pnpm dlx shadcn@latest add https://jb.desishub.com/r/star-rating.json
Usage
import { StarRating } from "@/components/star-rating";<StarRating rating={4.5} />
<StarRating rating={3} size="lg" showCount reviewCount={128} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
rating | number | - | Rating value (supports 0.5). |
maxRating | number | 5 | Maximum number of stars. |
size | "sm" | "default" | "lg" | "default" | Star size variant. |
showCount | boolean | false | Show numeric rating and count. |
reviewCount | number | - | Number of reviews to display. |

