Rating

Rating is a neobrutalist React component from Cruise UI. Stars filled with --primary and outlined in ink, with the number next to them: read-only (halves) or pick-a-score. Install it with npx shadcn@latest add @cruiseui/rating.

Install

Terminal

npx shadcn@latest add @cruiseui/rating

First time? Installation shows the one-off components.json setup (the @cruiseui registry) and how to turn the theme on.

Example

Corners
Your rating

When to use it

When to use

Showing an average score (4.5 · 120 reviews), or asking for one.

When not to

Anything that isn't a score out of a few stars (use a Slider or a Select).

Props

CruiseRating

PropTypeDefaultDescription
valuenumber—0 to max; read-only ratings may have halves (4.5).
max?number5—
count?number—Number of reviews, shown as "· 120 reviews".
label?string"Rating"Accessible name, e.g. "Your rating".
onChange?((value: number) => void)—Makes it interactive (whole stars).
showValue?booleantrue—
className?string——

Accessibility

  • Read-only: one image named "Average rating: 4.5 out of 5".
  • Interactive: native radios in a fieldset, so arrow keys work; each star is named "4 stars".
  • The number is shown, so the stars never carry the score alone.