Rating
Star rating with hover preview, half steps, read-only mode, custom glyphs and slider-style keyboard support.
3 files · 135 locdeps: clsx, tailwind-merge
Installation
With the shadcn CLI, pointing at this platform’s registry:
npx shadcn@latest add https://opusui.131199999.xyz/r/rating.jsonOr offline, straight from your opus55 checkout (copies every file it needs):
node ../tailwind_component/opus55/scripts/add.mjs ratingUsage
import { Rating } from "@/components/opus/ui/rating";
<Rating value={v} onValueChange={setV} allowHalf />API
| Prop | Type | Default | Description |
|---|---|---|---|
| value / defaultValue / onValueChange | number | — | Rating. |
| count | number | 5 | Glyphs. |
| allowHalf / readOnly | boolean | — | Half steps / display only. |
| icon / colorClassName | ReactNode / string | — | Custom glyph and fill colour. |