Components › Forms

Rating

Stars as a radio group with hover preview, arrow keys and a read-only mode.

Installation

npx plankui@latest add rating

Usage

import { Rating } from "@/components/ui/rating";

<Rating value={stars} onValueChange={setStars} />

API reference

PropTypeDefaultDescription
value / onValueChangenumber / (n) => void0Stars chosen.
maxnumber5Number of stars.
readOnlybooleanfalseDisplay only.
size"sm" | "md" | "lg""md"Star size.

View the source on GitHub