Skip to main content
Clever Ops

Review Summary Panel

A React reviews summary, average rating hero numeral, data-true star histogram bars in Tailwind hairlines, token-neutral stars with no gold clutter, and one verified highlight quote.

Preview & code

Loading Review Summary Panel preview

Installation

pnpm dlx shadcn@latest add @cleverui/review-summary-panel

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { ReviewSummaryPanel } from '@/components/ui/review-summary-panel'
Exampletsx
'use client'

import { ReviewSummaryPanel } from '@/components/ui/review-summary-panel'

const DISTRIBUTION = [
  { stars: 5, count: 812, countLabel: '812' },
  { stars: 4, count: 291, countLabel: '291' },
  { stars: 3, count: 98, countLabel: '98' },
  { stars: 2, count: 41, countLabel: '41' },
  { stars: 1, count: 42, countLabel: '42' },
]

export default function ReviewSummaryPanelDemo() {
  return (
    <div className="mx-auto flex w-full max-w-lg justify-center px-4 py-10 sm:px-6 sm:py-14">
      <ReviewSummaryPanel
        heading="Reviews"
        average={4.6}
        outOf={5}
        countLabel="1,284 reviews"
        distribution={DISTRIBUTION}
        highlight={{
          quote:
            'Wore the Field Jacket through a wet weekend in the Blue Mountains, stayed dry, still looks sharp after a week on the trail.',
          author: 'Maya Chen',
          detail: 'Verified buyer · Size M',
        }}
        verifiedNote="All reviews from verified orders"
      />
    </div>
  )
}

API reference

ReviewSummaryPanel accepts the following props.

PropTypeDefaultDescription
headingstring'Reviews'
average*numberhero numeral; also drives fractional star fill
outOfnumber5
countLabel*stringPREFORMATTED total, e.g. "1,284 reviews"
distribution*ReviewDistributionBand[]5 down to 1; bar width = count / max(count)
highlightReviewHighlight
verifiedNotestringquiet provenance, e.g. "All reviews from verified orders"

…plus everything from React.HTMLAttributes<HTMLElement>: className, event handlers, aria attributes and the rest pass straight through.

Referenced types

Typestsx
export interface ReviewDistributionBand {
  stars: number
  count: number
  /** PREFORMATTED display, e.g. "812", falls back to raw count */
  countLabel?: string
}

export interface ReviewHighlight {
  quote: string
  author: string
  /** e.g. "Verified buyer · Size M" */
  detail?: string
}

Frequently asked questions

How do I install the Review Summary Panel component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/review-summary-panel`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Review Summary Panel require?

Review Summary Panel uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Review Summary Panel to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services