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

Testimonials Slider

ProNew

Customer 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

pnpm dlx shadcn@latest add @viewport/testimonials-slider

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
testimonials*Testimonial[]—
titlestring

Heading 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"
totalnumber

Optional total shown on the badge when the supplied testimonials are a subset.

—
ratingnumber

Overall 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"
autoplaynumber

Milliseconds between automatic slides. Leave out to turn autoplay off.

—
linesnumber

Lines of quote shown before "Read more".

4
arrowsboolean

Show the previous and next arrows.

true
dotsboolean

Show the page dots.

true
loadingboolean

Shows three placeholder cards while the testimonials load.

false
emptyTextstring

Text shown when there are no testimonials.

"No testimonials yet."
colorstring

Star color. Any CSS color.

"#f5b301"
classNamestring—

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.