About
A star rating input built on a radio group for reviews and feedback, keyboard accessible, with a read-only display variant that shows fractional averages.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Rating to your project and fits it to your theme.
Code
How Rating is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import * as React from "react";
import { Rating } from "@/components/ui/rating";
export default function RatingDemo() {
const [value, setValue] = React.useState(0);
return (
<div className="flex min-h-40 w-full items-center justify-center">
<Rating aria-label="Rating" value={value} onValueChange={setValue} />
</div>
);
}
















