Testimonials Slider
ProNewCustomer quotes with stars and authors in a swipeable slider, grid or list. Inline and floating badges open a testimonial sidebar; optional customer photos open in a viewer.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| testimonials* | Testimonial[] | — |
| title | stringHeading above the cards. | — |
| layout | "slider" | "grid" | "list" | "badge" | "floating-badge"`slider` pages, `grid` and `list` show all, badges open a sidebar with all testimonials. | "slider" |
| total | numberOptional total shown on the badge when the supplied testimonials are a subset. | — |
| rating | numberOverall five-star score for the badge when `total` includes reviews not supplied in `testimonials`. | — |
| badgePosition | "left" | "right"Aligns the floating badge with the left or right edge of the viewport. | "left" |
| variant | "bubble" | "card"`bubble` is a speech bubble with the author underneath; `card` keeps the author inside a bordered card. | "bubble" |
| autoplay | numberMilliseconds between automatic slides. Leave out to turn autoplay off. | — |
| lines | numberLines of quote shown before "Read more". | 4 |
| arrows | booleanShow the previous and next arrows. | true |
| dots | booleanShow the page dots. | true |
| loading | booleanShows three placeholder cards while the testimonials load. | false |
| emptyText | stringText shown when there are no testimonials. | "No testimonials yet." |
| color | stringStar color. Any CSS color. | "#f5b301" |
| className | string | — |
Accessibility
- Arrows, dots and “Read more” are real buttons with names; the slider takes focus and pages with Left, Right, Home and End.
- Autoplay rests under the pointer or focus, has a Pause button and never starts under reduced motion.
- Badge drawers and photo viewers are modal dialogs: Escape closes them and focus returns to the trigger; photos change with Left and Right.
- Each quote is a figure with a blockquote and caption. Photos and badge loading have accessible names.
- One card per view on phones, two on tablets, three on desktop. Swipe on touch, drag with a mouse; reduced-motion dialogs do not animate.