kevingirelli

Rating

Forms

About

A star rating component for giving or showing a score, usable as an interactive radio group or a read-only display with fractional star fills.

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

import * as React from "react";
import { Rating } from "@/components/ui/rating";

export default function RatingDemo() {
  const [score, setScore] = React.useState(3);

  return (
    <div className="flex flex-col items-center gap-6">
      <div className="flex flex-col items-center gap-2">
        <span className="text-sm text-muted-foreground">Interactive</span>
        <Rating
          defaultValue={score}
          onValueChange={setScore}
          aria-label="Your rating"
        />
      </div>
      <div className="flex flex-col items-center gap-2">
        <span className="text-sm text-muted-foreground">Read-only</span>
        <Rating readOnly value={4.5} />
      </div>
    </div>
  );
}

Dependencies

More by kevingirelli

View all
  • Aurora

    Aurora

    54
  • Warp Gradient

    Warp Gradient

    48
  • FAQ Section

    FAQ Section

    46
  • QR Code

    QR Code

    46
  • Wave Text

    Wave Text

    37
  • Corner Frame

    Corner Frame

    36
  • Animated Border

    Animated Border

    32
  • Spotlight

    Spotlight

    23

More in Forms

View all
  • Premium Auth

    Premium Auth

    498
  • Login 2

    Login 2

    7
  • Login 1

    Login 1

    52
  • Authentication Card

    Authentication Card

    46
  • Contact Card

    Contact Card

    1K
  • Login Form

    Login Form

    6
  • Form

    Form

    16
  • Form

    Form

    136