About
A star rating input built on native radio buttons, with keyboard arrow support, half-star steps, a hover preview, and a read-only mode for showing an average rating with a count.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Star Rating to your project and fits it to your theme.
Code
How Star Rating is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import Rating from "@/components/ui/rating";
import { useState } from "react";
export default function RatingDemo() {
const [value, setValue] = useState(3);
return (
<div className="flex min-h-[320px] w-full flex-col items-center justify-center gap-10 bg-background p-10">
<Rating label="Rate this recipe" value={value} onValueChange={setValue} />
<Rating label="Rate with half stars" step={0.5} defaultValue={3.5} />
<Rating label="Average rating" readOnly value={4.3} count={1286} />
</div>
);
}
















