Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Testimonials Speaker Switcher Block for React

A band of avatar-and-name chips for five customers: choose one and the large quote in a raised card in a card below changes to theirs, with arrow-key control between the chips, one scrolling row on phones, and a polite announcement of the change.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A testimonials block where the visitor picks who they want to hear from, for React with Base UI. A compact header (Why teams moved their pipelines to Lathe, a fictional build service) sits above a band between the page's rails holding five chips, each with the customer's initials avatar and name; the chosen chip is filled with your foreground colour and the others are outlined. Below the band, one large quote sits in a raised card in a card (a tinted shell around a lifted panel) with a quote mark behind it and the author's avatar, name, role and company under it. Choosing another chip fades the new quote in. The panel keeps the height of the longest quote, so nothing below it moves. On a phone the chips are one scrolling row with the next chip peeking in, so the quote stays on the first screen. Nothing changes on its own, so there is no autoplay to pause, and the block has no primary control. It's built from Segment Group, Avatar and Guides, with CSS transitions for the entrance and the change. For homepages and landing pages where visitors want to hear from someone like them, and recognise names, without wading through a grid.

FAQ

How do I change the customers or their quotes?

Edit SPEAKERS at the top of the file: each entry has an id, the person's name, role, company and initials, and their quote. The chips come from the list, so any number of customers works; four to six fit in one row on a desktop, and a phone scrolls them. The first one in the list is shown when the page loads. Keep quotes to a few lines: the big type is meant for a sentence or two, not a paragraph.

How do the chips work on each library?

They're the Segment Group built on Base UI's radio group, with value and onValueChange holding the chosen customer in React state. The sliding indicator is hidden, so the chosen chip is filled instead.The chosen chip carries bg-foreground text-background, so it follows your theme in light and dark and leaves the primary colour for a call to action elsewhere on the page.

Can visitors choose with a keyboard?

Yes. The chips are one radio group: Tab moves focus to the chosen chip, the left and right arrow keys move to the previous or next chip and choose it, wrapping at either end, and Tab moves on. Each chip shows a focus ring. Unlike the original, the block doesn't listen for arrow keys anywhere on the page, so it never takes the arrows from a visitor who is scrolling or typing somewhere else.

What does a screen reader announce?

The chips are a radio group named "Choose who is speaking", and each radio is named for its customer, such as "Saskia Vermeer", with the chosen one marked as checked; the avatar initials are hidden. The quote is a blockquote inside a figure with the author as the caption. Nothing is announced when the page loads; once the visitor chooses a customer, the area holds a polite live region and the new quote is read out.

What changes with reduced motion, and what about right-to-left?

The header and the panel appear without their entrance, and a new quote replaces the old one without the fade. In a right-to-left page the chips run from the end side, the avatar sits on the right of each name, the quote mark moves to the end corner and the text aligns to the end. Quotes and names keep their punctuation in place.

When is a speaker switcher better than a grid or a carousel?

When who says it matters as much as what is said: visitors who recognise a role or a name go straight to it. A switcher shows one quote at a time, so it suits a handful of strong stories. If you want every quote visible at once, use a grid or a wall; if you have many quotes and no names worth choosing by, a carousel pages through them without asking for a choice.

  • Pro

    Customer stories for a site builder on slides in one hairline band: each pairs a framed portrait, a monogram on a grid with the result the customer got, with the quote, split by a divider, and a footer row with a 01 / 04 count and previous and next buttons, under a header with one Shine Button.

  • Pro

    Three tabs of customer quotes, Product, Support and Value, in two bands between the rails: the active tab's underline fills over eight seconds and then the next quote opens in a closing band, with a pause button in the header, a hold on hover and focus, and no autoplay under reduced motion.

  • Pro

    A centred statement: one customer quote above a stack of team avatars that is a button, fanning open a roster of six teams in one hairline band, each with a name, a role and a one-line verdict.

  • Pro

    A centre-mode quote carousel for a support inbox: a centred header with a Shine Button above one hairline band, where the active quote sits in the middle on a raised card with its neighbours peeking in, with previous and next buttons, a dot per quote and arrow-key control.

  • Pro

    A giant centred quote set as typography in a ruled band, with small avatar and icon chips sitting between its words like inline pictures, and a footer band that splits into the author and a Shine Button to the full story.

  • Pro

    A 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.