Join our Discord Community
Interactive

Rating

Interactive star rating component for React and Next.js applications. Built with TypeScript support, Tailwind CSS styling, and shadcn/ui design featuring keyboard navigation, hover effects, and form integration.

Powered by

Loading component...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/rating.json
npx shadcn@latest add https://www.shadcn.io/registry/rating.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/rating.json
bunx shadcn@latest add https://www.shadcn.io/registry/rating.json

Features

  • Interactive stars - Click and hover rating selection with visual feedback using JavaScript events
  • Keyboard navigation - Arrow key support and accessible focus management for React applications
  • Form integration - Hidden input fields for seamless form library compatibility using TypeScript
  • Customizable appearance - Star count, size, colors, and icons with Tailwind CSS styling
  • Read-only mode - Display-only ratings with proper ARIA attributes for Next.js projects
  • Accessible design - Complete ARIA support and screen reader compatibility using shadcn/ui patterns
  • Open source - Free rating component with Lucide icon integration

Examples

Custom colors

Loading component...

Custom size

Loading component...

Custom icon

Loading component...

Controlled

Loading component...

Use Cases

  • Product reviews - Customer feedback and rating collection systems
  • Content rating - Article, video, and media quality assessments
  • Skill assessment - User proficiency and experience level indicators
  • Satisfaction surveys - Service quality and experience feedback forms

Implementation

Built with Lucide Star icons and native button elements. Works with React Hook Form and other form libraries. Supports controlled/uncontrolled modes with proper state management.