shadcn.io is not affiliated with official shadcn/ui
Metric Testimonials Block for React
Four testimonials for a UI kit in one hairline band, each cell headed by its own big figure, a gain, a multiple, a drop or a new value worked out from a before and an after, with the quote and the person underneath.
Installation
Overview
Pair a number with the voice behind it in a testimonials section for React with Base UI. Four cells share one band of hairlines, with + marks on its corners: four in a row on wide screens, two by two on tablets, and a snap carousel on phones, each cell 80% wide so the next one peeks in. Each leads with a large figure, such as +40%, 3x, −60% or 2 days, then the label that says what was measured, a small chip with the before and after it came from, and under a rule the customer's quote with their initials, name and role. The cells share their rows, so figures, labels, quotes and names line up even when a quote runs longer. A Shine Button in the header row, the block's one primary control, links to the customer stories. The copy speaks for Stitchbook, a fictional UI kit. It's built from Badge, Avatar, Shine Button and the Guides lines, with CSS entrances that stay still under reduced motion and your theme's tokens only. For landing pages, pricing pages and case-study hubs where each quote has a result to back it.
FAQ
How do I change the figures and quotes?
Edit RESULTS at the top of the file. Each result has a before and an after, the unit they count, a label, a kind and the quote with its person. The big figure is worked out from the numbers: gain shows the rise in percent, drop the fall, times the multiple, and now simply shows the new value with its unit. The chip under the label repeats the before and after, so the figure and its source can never disagree. Only put real numbers here.
How is the percentage worked out?
It is Math.round((change * 100) / before), whole numbers only, so 20 to 28 points is +40% and 50 to 20 reports is −60%. There is no floating-point subtraction like 1 - 28 / 20 to drift. The minus sign is a real minus (U+2212), not a hyphen.
How do the cells line up?
From md the list is a CSS grid with a 1px gap on a bg-border background, which draws the shared hairlines, and each cell is a subgrid that spans three rows: figure, label with its chip, and the quote with the person. Row heights come from the tallest cell, so nothing needs a fixed height. On phones the cells are a row that scrolls sideways and snaps to each cell.
What do screen readers read?
The four cells are a list named "Customer results". Each reads its figure, its label and the chip as "from 20 to 28 points", then the quote as a figure with a blockquote and a caption naming the person and role. The avatars are decorative, since the name is right beside them. The section's only heading is its h2.
Related
- Pro
Sortable Results Table Testimonials
Results and figuresA results table of five customers with a before, an after and the change between them, whose column headers sort it, in a band between the rails: a split divider sets the quote of whoever is at the top of the table apart from the table, with + marks where it meets the band's rule.
- Pro
Animated Count Testimonials
Results and figuresThree headline figures that count up to their totals when the section loads, in one hairline band with a Replay button that runs the count again, and two customer quotes in a second band beneath.
- Pro
Enterprise Testimonials with Fact Sheets
Results and figuresThree enterprise customers in cells that share their hairlines, each a quote above a fact sheet that is always in view (seats, regions and weeks to roll out), with a closing band that holds a Shine Button and a second action.
- Pro
Impact Ring Testimonials
Results and figuresFour impact rings in a reverse split: each result is a share worked out from the customer's own counts, drawn as a ring with its percentage inside, in cells that share hairlines beside a header with a Shine Button.
- Pro
Inline Metric Testimonials
Rows and listsFour customer quotes in ruled bands where the result sits inside the sentence as a chip: an arrow and the change in percent, worked out from the two figures the customer gives.
- Pro
Left-Heavy Metric Cards Hero
Stats and live dataA split hero for an API host: copy and two calls to action beside a column, behind a divider, of three metric cells whose lines overshoot their corners and whose figures roll up into view.