Reviews
ProNewA supplied-data reviews section with source tabs, overall rating, an optional summary and photo cards in carousel, grid, masonry or list layouts.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| reviews* | Review[] | — |
| layout | "carousel" | "grid" | "masonry" | "list"`carousel` pages sideways, `grid` and `masonry` wrap cards with load-more, `list` stacks rows. | "carousel" |
| title | stringHeading above the overall rating. | "Overall Rating" |
| rating | numberOverall rating. Defaults to the average of `reviews`. | — |
| total | numberTotal review count, when it is more than the reviews you pass. | — |
| summary | string[]Points of an AI-written summary, shown as the first card. | — |
| tabs | booleanShows a tab per source that filters the reviews. Needs at least two sources. | true |
| pageSize | numberReviews shown before "Load more" in the grid and list layouts. | 6 |
| lines | numberLines of text before a review is cut with "Read more". | 4 |
| onWrite | () => voidCalled by the "Write a review" button, which is hidden without it. | — |
| className | string | — |
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.