shadcn.io is not affiliated with official shadcn/ui
Cards Testimonials Block for React
Three customer quotes for an invoicing app in cells apart on hairline frames with + marks, each led by its result, with the middle one raised and a header that carries the rating and one Shine Button.
Installation
Overview
A testimonials section for React with Base UI where the numbers speak first. A compact header says what the product does and carries the rating, with one Shine Button that links to every review. Below it, three quotes sit in cells set apart on the page column. Each cell draws its own hairline frame with a + mark on its first corner and lines that run a little past the corners, so the cells read as drawn on the same sheet as the page's rails. Every card opens with the result that customer got in display type, then the stars, the quote and who said it. The middle card is raised: a card surface with a ring, a shadow and larger type, with a Most shared badge, and it is read first on every screen. It's built from Avatar, Badge, Guides and Shine Button with CSS transitions only and your theme's tokens, and the stars are drawn in the text colour, so the Shine Button is the only coloured element.
FAQ
How do I change which card is raised?
Edit QUOTES at the top of the file and set featured: true on the card you want, and false on the others. Only one card should carry it. The badge text, "Most shared", is a label you write, not something the block works out. Each quote also carries its result, a figure and a label that follows it, so write the number the customer would point to.
Will the raised card look right in every theme?
Yes. It doesn't use your primary colour at all. The emphasis comes from structure: a bg-card surface with a thin foreground ring and a shadow, which lifts it in light and dark and in every preset, including themes where the card and page colours are almost the same. The one primary element in the block is the Shine Button.
What happens on a phone?
Below the large breakpoint the cells stack in one column with the raised one on top, so the strongest quote is the first thing read. In the file it is first too; from the large breakpoint a grid position moves it to the middle. There are no links or buttons in the cards, so the focus order is unaffected, and the whole section stays well under three screens tall.
How are the ratings shown?
The stars are decoration and a screen reader reads one sentence instead, such as "Rated 4 out of 5". Each card sets its own rating, and filled and empty stars are drawn from the same data in the text and border colours. The header's average is plain text, so edit it with the numbers you have. Use a rating only if the customer gave one.
How does a screen reader read the cards?
The cards are a list, and each is a figure with the quote in a blockquote and the author in its caption. The section's heading is an h2, and the cards have no headings of their own. The initials avatars and the line frames are hidden, since the name is written beside them and the lines are decoration.
Related
- Pro
Headline Testimonials
Quote gridsA side header and a hairline grid of Sundial customers' quotes: the page column splits at `lg`, each quote leads with its takeaway as a large headline, and on a phone the six cells become one snap row.
- Pro
Mini Cards Testimonials
Quote gridsEight square tiles in a hairline grid, each holding a one-line customer quote at the top and its author at the foot, with the one Shine Button in the header row.
- Pro
Three Column Testimonials
Quote gridsThree customer quotes with no card chrome: a centred header over one closing band of three columns, each a large initials avatar over a centred quote, divided by hairlines.
- Pro
Centered Testimonial Card Grid Hero
TestimonialsA centred showcase hero with a headline, a Shine Button and an outline action over a wall of six customer quotes in cells that share their hairlines, a snap carousel on a phone.
- Pro
Three Columns Pricing
Plan cardsThe canonical three-column pricing section for a team knowledge base: Personal, Team and Company cells under a monthly and yearly switch, each outlined by hairlines that overshoot its corners, the recommended plan raised, one plan at a time on phones.
- Pro
Bento Grid Testimonials
Quote gridsA quote-only bento drawn with hairlines: one large lead story beside four shorter quotes, in cells that share their lines, on the page's drafting lines.