Mohammad Shehadeh

Rating

Component

About

Star rating with hover preview, half-star precision, read-only mode and sm / md / lg sizes.

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 [value, setValue] = React.useState(3);

  return (
    <div className="flex min-h-[240px] w-full items-center justify-center bg-background p-8 text-foreground">
      <div className="grid gap-2">
        <p className="text-xs text-muted-foreground uppercase">
          Interactive rating
        </p>
        <Rating
          value={value}
          onValueChange={setValue}
          aria-label="Overall rating"
        />
      </div>
    </div>
  );
}

Dependencies

More by Mohammad Shehadeh

View all
  • Feature Problem Cards

    Feature Problem Cards

    83
  • Feature Grid Spotlight Cards

    Feature Grid Spotlight Cards

    69
  • Dithered Shader CTA

    Dithered Shader CTA

    63
  • Split Login

    Split Login

    60
  • FAQ Two Column

    FAQ Two Column

    59
  • Ecommerce Category Page

    Ecommerce Category Page

    57
  • Comparison Table

    Comparison Table

    57
  • Comparison Section

    Comparison Section

    56