bearnie

Rating

A star rating display supporting fractional values.

Installation

npx bearnie add rating
npx bearnie add rating

Usage

import { Rating } from "@/components/bearnie/rating"
<Rating value={4.5} />

Purely static — no JavaScript. Fractional values render partially filled stars, and screen readers get a “Rated 4.5 out of 5” label instead of five decorative icons.

Examples

With text

4.5 · 1,238 reviews

Sizes and color

Stars inherit their size from the [&_svg] utility and their color from text-primary — override both with classes.

Custom maximum

Props

Prop Type Default Description
value number required Rating value; fractions render partial stars
max number 5 Number of stars
label string Rated 4.5 out of 5 Custom accessible label
class string - Additional CSS classes