042
Two ways to ask how it went: stars with half steps that pop when you pick, and a little face that morphs from grumpy to delighted as you slide across the scale.
akarating·star rating·stars
Run this in any project set up for the shadcn CLI. It copies the Star & Emoji Rating source into your components folder, so the code is yours to change.
npx shadcn@latest add https://devl.dev/r/star-and-emoji-rating.jsonImport it and render it. Every prop has a typed default, so it works straight away, and you pass your own data when you’re ready.
import { StarRating } from "@/components/star-and-emoji-rating";
export default function Page() {
return <StarRating />;
}A free React component in the Forms collection, written in TypeScript with Tailwind CSS on coss ui. MIT licensed.
Read from the Star & Emoji Rating source. Everything is optional unless it says required.
| Prop | Type | Default |
|---|---|---|
| value | number | — |
| defaultValue | number | 0 |
| onValueChange | (value: number) => void | — |
| max | number | 5 |
| half | boolean | true |
| size | number | 28 |
| readOnly | boolean | false |
| words | string[] | false | STAR_WORDS |
| className | string | — |
| aria-label | string | — |