shadcn.io is not affiliated with official shadcn/ui
Masonry Testimonials Block for React
A 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.
Installation
Overview
A masonry wall of customer voices for Stridewell, a fictional running coach. Twelve quotes of every length sit in CSS columns, so a one-line note and a three-sentence story stack tight with no gaps and no fixed card heights. The wall is one column on a phone, two from the sm breakpoint and four from lg, and sits in a figure drawn with hairlines and + marks on its corners. Each card carries the quote, its author's initials, name and role, and some add a star rating in foreground tones. The header row holds the one filled Shine Button. On a phone the wall is cut short and faded at its foot until "Show all 12 notes" lifts it. Built from Card, Avatar, Button, Guides and Shine Button. For landing pages where the number of happy customers is the argument.
FAQ
How do I change the number of columns?
Change the columns-1 sm:columns-2 lg:columns-4 classes on the list. The browser fills each column from the top and balances them, so more quotes or longer ones never need any other change. gap-4 sets the space between columns and mb-4 on each item the space between cards; break-inside-avoid keeps a card whole instead of splitting it across two columns.
In what order do the quotes read?
Down the first column, then the second, and so on, which is also the order in the file and the order a screen reader follows. A grid fills row by row instead, so if you would rather read across, use a plain grid. Put the quotes you most want read first at the top of the list: they land at the top of the first column.
What happens on a phone?
The wall is a single column cut at 34 rem with a fade at its foot, so the page isn't twelve cards long. A ghost button, "Show all 12 notes", lifts the cut. It reports aria-expanded and names the wall it controls. The notes behind the cut are still in the page for screen readers. From md the whole wall always shows.
How do I use my own quotes?
Edit QUOTES at the top of the file. Each entry has the quote, the author's name, initials and role, and an optional rating from 1 to 5. The wall shows exactly the quotes it is given, so adding or removing one needs no other change; the heading names the count, so update that too, and the button's count follows the list. The twelve people here are made up.
Is the wall accessible?
Yes. It is a list named Runner notes, and each item is a figure with the quote in a blockquote and the author in its figcaption. The stars are decorative: each rating is said once in words, as Rated 5 out of 5, and the initials avatars are hidden because the name follows them. Quote marks sit in a bdi element, so they stay put in right-to-left languages.
Related
- 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
Density Switch Testimonials
Walls and lanesTwelve customer quotes from Lantern's support teams in one hairline grid, with a density switch in the header: Comfortable, Compact or Quotes only re-tunes the same cells, from roomy with stars and roles down to the bare words.
- 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
Vertical Marquee Testimonials
Walls and lanesA 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.
- Pro
Split Social Proof Wall Hero
TestimonialsA reverse split hero with a wall of nine short customer quotes on shared hairlines at the start, the centre one raised and rated, and the headline and a Shine Button at the end.