Rating

Radio GroupScroll Area

Star rating, interactive or read-only with half stars.

Your rating
4.5 average from 1,284 reviews

Installation

pnpm add krz-ui

Usage

import { Rating } from "krz-ui";
<Rating label="Your rating" value={stars} onValueChange={setStars} />

<Rating readOnly value={4.5} size="sm" />

API Reference

PropTypeDescription
value / defaultValuenumberControlled or initial rating. 0 means none.
onValueChange(value: number) => voidCalled on select. Clicking the current value clears it.
maxnumberNumber of stars. Defaults to 5.
readOnlybooleanDisplay only; fractional values show partial stars.
size"sm" | "md" | "lg"Star size.
iconReactNodeCustom icon, e.g. a heart.
className / style / ref—All go to the outer element. See Customization.
classNames{ label?, stars?, star?, icon? }Extra classes for inner parts.