Rating

A star rating component with keyboard navigation and hover effects.

Installation

npx love-ui@latest add rating

Usage

import { Rating } from "@/components/rating"
<Rating
  defaultValue={3}
  max={5}
  size={24}
  onValueChange={(value) => console.log(value)}
/>

Features

  • Customizable number of stars and size
  • Support for keyboard navigation
  • Hover and focus states
  • Accessible ARIA attributes
  • Read-only mode
  • Hidden input support for forms

Examples

Custom colors

Custom size

Custom icon

Controlled