Primitives

Rating

Hover previews, click again clears, half steps, word labels; read-only with a count.

Rate your visit · hover to preview, click again to clear

Great

readOnly · with the count

4.6 (128)
3.2 (46)

Import#

Everything comes from the package root. The example above uses:

your-component.tsx
import { Rating } from "@waveinno/ui";

Props#

Read from the source of this version, so they match the code exactly.

<Rating>

src/components/ui/rating.tsx
PropTypeDefaultDescription
valuenumber—
defaultValuenumber0
onValueChange(value: number) => void—
maxnumber5
allowHalfbooleanfalse
readOnlybooleanfalse
icon"star" | "heart""star"
size"sm" | "md" | "lg""md"
labelsstring[]—One word per whole score, from 1.
countnumber—Read-only: the number of ratings behind the score.
aria-labelstring"Rating"
classNamestring—

Install#

If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.

$ npm install @waveinno/ui