shadcn.io is not affiliated with official shadcn/ui
Minimal Slider Testimonials Block for React
Scrub through customer quotes for a shared-inbox app with a real range slider: five stops, one quote fading in at each, in a framed stage with + marks on its corners and the slider on a ruled foot, its position read out in words.
Installation
Overview
Let visitors scrub through the quotes. A header at the start introduces five notes from teams on a shared inbox. Below it, a framed stage with + marks on its four corners holds one large, centred quote with its speaker; its foot is ruled off and holds a single Slider with five stops. Drag the handle, or press the arrow keys, and the quote cross-fades to the next team's. A "1 of 5" count tracks the position beside the label. It's the quietest way to carry several quotes: no cards, no arrows, no timer and no primary button, just one control that does one thing. The slider is neutral, so primary stays free for a real call to action elsewhere. It uses Avatar, Guides, Lucide's quote mark, CSS transitions only and your theme's tokens. For landing pages that want social proof to feel considered.
FAQ
How do I change the quotes or the number of stops?
Edit the TESTIMONIALS array at the top of the file: each entry has an author, role, company, two-letter initials and the quote. The slider's range, its position label and the words read out to screen readers all follow the length of the array, so a sixth quote gets a sixth stop with no other change.
How does the slider drive the quotes?
The slider's value is a quote's index. Every quote sits in the same grid cell, so the longest one sets the stage's height and nothing moves when the slider does; the one at the slider's value is visible and the rest are invisible, and a CSS transition on opacity cross-fades between them. Dragging, clicking the track and the keyboard all update the same value.
How is the stage drawn?
A Guides with extend="sm" marks="corners" draws the frame, and a second one with marks="top" rules="top" draws the rule above the slider, with + marks where it meets the frame's sides. The slider's range and thumb are overridden to the foreground colour.
Can visitors use it with a keyboard?
Yes. The handle is the one tab stop. The left and right arrow keys move one quote at a time, and so do up and down, and Home and End jump to the first and the last. The quotes that aren't showing are hidden from assistive technology, so only the visible one is read.
What does a screen reader announce?
The slider is named "Quote" and its value is read in words rather than as a bare number: "Quote 3 of 5, Lucia Ferrante, Design Lead". When a drag or a key press ends, a polite live region says the same thing, so the visitor hears the speaker they landed on instead of every speaker they passed; nothing is announced on load.
Related
- Pro
Quote Carousel Testimonials with Next-Speaker Preview
Carousels and decksA centred, looping carousel of large customer quotes in a card in a card, whose Previous and Next buttons preview who speaks next, with the neighbour's avatar and first name.
- Pro
Rotating 3D Wheel Testimonials
Carousels and decksA 3D wheel of customer quotes in a framed figure under a centred header: the active quote faces you flat while its neighbours tilt away above and below, and up and down buttons in a footer strip turn the drum.
- Pro
Layered Quote Deck Testimonials
Carousels and decksA deck of four customer quote cards in a framed figure under a centred header: the front card sits on two peeking cards, and the Shine Button sends it to the back so the deck cycles.
- Pro
Triple Stack Vertical Carousel Testimonials
Carousels and decksA vertical carousel with three customer quotes in view: each press of the up or down button moves one row, with a count of which quotes are showing.
- “Pro
Featured Testimonial Hero
TestimonialsA compact start-aligned hero with a headline, a Shine Button and an outline action over a closing band that holds one customer's quote, large, beside their rating, name, role and the number it is about.
- Pro
Quote Carousel Testimonials
Carousels and decksA split testimonials carousel for a CI service: the heading and a Shine Button beside a raised card in a tinted shell that follows the theme, advancing by itself under a story-style progress bar with pause, previous and next.