Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Reviews

ProNew

A supplied-data reviews section with source tabs, overall rating, an optional summary and photo cards in carousel, grid, masonry or list layouts.

Installation

pnpm dlx shadcn@latest add @viewport/reviews

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
reviews*Review[]—
layout"carousel" | "grid" | "masonry" | "list"

`carousel` pages sideways, `grid` and `masonry` wrap cards with load-more, `list` stacks rows.

"carousel"
titlestring

Heading above the overall rating.

"Overall Rating"
ratingnumber

Overall rating. Defaults to the average of `reviews`.

—
totalnumber

Total review count, when it is more than the reviews you pass.

—
summarystring[]

Points of an AI-written summary, shown as the first card.

—
tabsboolean

Shows a tab per source that filters the reviews. Needs at least two sources.

true
pageSizenumber

Reviews shown before "Load more" in the grid and list layouts.

6
linesnumber

Lines of text before a review is cut with "Read more".

4
onWrite() => void

Called by the "Write a review" button, which is hidden without it.

—
classNamestring—

Accessibility

  • Source tabs, arrows, page dots and every photo are real buttons with names.
  • Long reviews fold behind “Read more” only when the text is actually cut at that width; unsafe original-review links are not rendered.
  • Photos open in a dialog that traps focus; Left and Right change photo, Escape closes and returns focus to the photo.
  • One carousel card per view on phones, two on tablets, three on desktop. Photo/backdrop entrances are paired, with no sliding or fades under reduced motion.