Industry Tabs
An interactive tab bar for filtering testimonials by industry (e.g. Retail, Healthcare, Finance). Each tab owns its own array of testimonials via props; clicking a tab swaps the entire set of quote cards shown below using real local state, not a purely visual highlight.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its avatar, avatar-initials dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/industry-tabs.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/testimonials/testimonial16.tsx instead.
Usage
The file also exports testimonial16Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Testimonial16, testimonial16Demo } from "@/components/blocks/testimonials/testimonial16"; export default function Page() { return <Testimonial16 {...testimonial16Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | undefined | Optional heading above the tab bar. |
| description | string | undefined | Optional supporting text below the heading. |
| tabs | IndustryTab[] | none | Each tab has an id, a label, and its own array of testimonials shown when that tab is active. |
| className | string | none | Extra classes for the outer section element. |
Types
type IndustryTestimonial = { quote: string; name: string; role: string; }; type IndustryTab = { id: string; label: string; testimonials: IndustryTestimonial[]; };
Behavior notes
- This is a real, functional filter: clicking a tab button calls setActiveId with that tab's id, and the quote grid below re-renders from tabs.find((tab) => tab.id === activeId).testimonials — it is not a decorative highlight over a single static list.
- The first tab in the tabs array is selected by default via useState(tabs[0]?.id ?? ""); this is computed once from props at initial render, not derived in a useEffect.
- Tab buttons use role="tab"/aria-selected and are wrapped in a role="tablist" container; the filtered results below are in a role="tabpanel" linked via aria-controls/aria-labelledby.
- demoProps live in a separate sibling file, testimonial16.demo.tsx, per the client-component demo-file-split rule — this file only exports the component.
More Testimonials Blocks
View all →Single Large Quote
One large centered pull-quote with a decorative quote mark and a simple avatar attribution below.
Three Column Grid
Responsive grid of quote cards, each with a star rating, avatar, name, role, and quote text.
Quote Carousel
Interactive one-at-a-time quote carousel with prev/next arrows and clickable dot indicators.
Video Testimonial Grid
Grid of video-style testimonial cards, each a 16:9 thumbnail with a play-button overlay and a caption.
Masonry Wall
"Wall of love" style masonry layout of many short quote cards using CSS columns, not a JS library.
Quote With Stats Sidebar
Split layout pairing a large quote and attribution with a sidebar of 2-3 result stats.