Staaarter

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.

By Staaarter Team
Testimonials
Docs
Live preview

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

Prefer 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

PropTypeDefaultDescription
headingstringundefinedOptional heading above the tab bar.
descriptionstringundefinedOptional supporting text below the heading.
tabsIndustryTab[]noneEach tab has an id, a label, and its own array of testimonials shown when that tab is active.
classNamestringnoneExtra 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.