Kaapi UI
Back to Design System

Rating Badge and Stars

Components for displaying user ratings and reviews, available in star-based or badge formats.

1. Rating Stars

Displays a numeric rating using five stars, including partial filling for decimal values.

import { RatingStars } from "@/components/ui/rating";

<RatingStars rating={3.5} />

2. Rating Badge

Displays a rating in a compact badge format, with a title and subtitle to provide context (e.g., number of reviews).

Best Design Tool

2,000+ reviews

import { RatingBadge } from "@/components/ui/rating";

<RatingBadge 
  rating={4.7} 
  title="Best Design Tool" 
  subtitle="2,000+ reviews" 
/>

API Reference

RatingStars Props

PropTypeDefaultDescription
ratingnumberThe current rating value, usually between 0 and 5. Supports decimals.
maxStars?number5The maximum number of stars to display.

RatingBadge Props

PropTypeDefaultDescription
ratingnumberThe rating value, typically formatted with one decimal.
titlestringThe main title of the badge (e.g., "Best Tool").
subtitlestringThe subtitle providing context (e.g., "2,000+ reviews").