shadcn.io is not affiliated with official shadcn/ui
Vertical Marquee Testimonials Block for React
A ruled wall of notes from home cooks: up to three lanes drifting up, down and up inside a hairline band, with a pause button, the one Shine Button, and a pause on hover and focus.
Installation
Overview
A wall of customer notes that never runs out, for Larder, a fictional meal-planning app. Three lanes of quotes drift past in a fixed window, the first and third upwards and the middle one downwards, at slightly different speeds so they never line up. Every note is a cell that shares its hairlines with the next one, and the lanes are divided by a single vertical line inside a band whose corners carry + marks, so the wall reads as a ruled ledger rather than a pile of cards. The top and bottom of the window fade out with a CSS mask, so notes appear and leave softly. The header row holds a pause button and the one filled Shine Button. The columns also stop while the pointer is over them or focus is inside. It is a vertical counterpart to the horizontal review strips. Two lanes show from the md breakpoint, three from lg, one on a phone, where the window is shorter. Built from Marquee, Avatar, Button, Guides and Shine Button.
FAQ
Can visitors stop it moving?
Yes, three ways. The pause button in the header row stops every lane and becomes a play button; it is a toggle, so its state is announced. The lanes also pause while the pointer is over them or keyboard focus is inside, so a note can be read in peace. And with reduced motion on, they never move: the button is hidden and each lane becomes a plain scrollable list.
How do I change the lanes, speed or direction?
Edit LANES at the top of the file. Each lane has its quotes, a speed in pixels per second, reverse to run it the other way, a label that names the lane for screen readers and appears, the class that decides from which width it shows. Give each lane enough quotes to fill the window, since the loop repeats the content to fill it; five notes fill the 30 rem window with room to spare.
What do screen readers get?
Each lane is a named region, Cook notes, first column and so on, and each note is a figure with a blockquote and a figcaption. The copies that make the loop are hidden from screen readers and removed from the tab order, so every quote is read once. Nothing in the notes is focusable, so the keyboard only meets the pause button and the link.
What exactly moves?
The lanes scroll with a CSS animation that comes from the Marquee component, with no JavaScript frame loop and no animation library. The header and the wall also fade up once on load. With reduced motion on, nothing moves, the fade mask is removed so the first and last notes are fully visible, and each lane scrolls by hand.
Where does the button go?
It's a link to href="#": point it at your sign-up. It's a ShineButton with render set to an a element and nativeButton={false}. The pause button is a normal button: it uses onClick on Ark, Base UI and Radix and onPress on React Aria.
How does it fit on a phone?
Below md only the first lane shows, filling the width, in a 24 rem window, then two lanes from md and three from lg in a 30 rem window. The window is a fixed height at every width, so the page never jumps as notes scroll. Lanes that are not shown are not rendered, so they do not run in the background.
Related
- Pro
Masonry Testimonials
Walls and lanesA masonry wall of twelve notes from runners in CSS columns inside a framed figure: cards of every length stack tight, from one column on a phone to four on a wide screen.
- Pro
Clipped Wall Testimonials
Walls and lanesA wall of twenty-four short customer notes for a component kit, set as a masonry band that shares its hairlines and fades out under a mask until a Show all button opens the rest.
- Pro
Waterfall Testimonials
Walls and lanesNine customer quotes for a deploy platform in a staircase of three columns, one per stage of being a customer, each starting a step lower, in cells whose lines overshoot their corners.
- Pro
One-Liner Pills Testimonials
Expand, flip, pinOne-line customer quotes in two ruled bands: the best line at display size, then a cloud of fourteen pill buttons that open a small card with who said it, under a compact header with a Shine Button.
- Pro
Dual Row Marquee Testimonials Hero
TestimonialsA compact centered hero for a support inbox with a Shine Button and, on its own rule below, two rows of short customer reviews that scroll in opposite directions, with a button to pause them.
- Pro
Logo Marquee Hero
Logos and social proofA compact hero for a support platform: copy and two calls to action, then two bands across the column: a strip of customer logos that scrolls on its own with a pause button, and a row of three stats.