Testimonial Section
An accordion of quotes where one is always open.
- Category
- Marketing
- Access
- Free with an account
- Source
- 434 lines · one file
When to use it
Use Testimonial Section for customer quotes on a marketing page: a heading, cards with name, role, company and rating, and one quote opened larger.
Installation
How you get it
Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.
Use Liro's Testimonial Section for this.
Install it: npx shadcn@latest add @liro/testimonial-section
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/testimonial-section.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Free components install through the @liro registry with your CLI token: see the Namespaced tab.
Usage
import { TestimonialSection, type Testimonial } from "@/components/ui/testimonial-section";
const items: Testimonial[] = [
{ name: "Ada Moss", role: "Head of Finance, Vertically", quote: "We closed the month two days earlier.", rating: 5, tone: "mint" },
{ name: "Ravi Shah", role: "Founder, Orbit", quote: "Our signing flow finally makes sense to customers.", tone: "sky" },
];
export function Testimonials() {
return <TestimonialSection eyebrow="Customers" title="Teams that ship with us" items={items} />;
}API reference
“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Type | Notes | ||
|---|---|---|---|
items | Testimonial[] | Yes | – |
eyebrow | React.ReactNode | No | Small line above the heading. Pass null to hide it. |
title | React.ReactNode | No | Section heading. |
description | React.ReactNode | No | Supporting line under the heading. |
defaultOpenIndex | number | null | No | Index of the card open on first render. `null` for all closed. |
label | string | No | Accessible name for the scroll region. |
Dependencies
npm packages
clsxframer-motiontailwind-mergeLiro foundations, installed alongside it
liro-themetestimonial-avatarAccessibility
- Keyboard reachable throughout, in visual order
- Focus trapped in overlays, Escape closes them
- Focus returns to whatever opened it
- Live regions announce what changed, not that something did
- Honours prefers-reduced-motion
Responsive behavior
- Sizes to its container, not the viewport
- Usable from 320px up
- Pointer-based interaction, so trackpad and touch both work
- No hover-only affordances