Skip to content
RivetUI

Rating

Captures a single score through a compact, keyboard-accessible star scale.

@rivetui/rating

Preview

Explore each composition interactively, then open its code in the same context.

Controlled

Read the selected score immediately while preserving native form behavior.

04 / 05

Sizes

Use the size that matches the surrounding control density.

Required

Connect required ratings to a visible and announced validation message.

Registry

Installation

Add the component source and its declared dependencies with the shadcn CLI.

Install component
bunx --bun shadcn@latest add @rivetui/rating
Inspect registry item

Public interface

API reference

Component-specific props are listed here. Native element and Base UI props continue to pass through.

PropTypeDefault
valuenumber—
defaultValuenumber—
onValueChange(value: number, details) => void—
maxnumber5
size"sm" | "md" | "lg""md"
getItemLabel(value: number, max: number) => string"{value} out of {max} stars"
namestring—
requiredbooleanfalse
disabledbooleanfalse
Rivet UI / RatingComponents engineered, not decorated.