Staaarter

Vertical Tab Panel

A traditional tab interface for category-based FAQs: a left vertical list of category tabs with active-state styling, and a right content panel that swaps to that category's Q&A entries, each shown fully open with no further accordion needed.

By Staaarter Team
FAQ
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/vertical-tab-panel.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/faq/faq54.tsx instead.

Usage

The file also exports faq54Demo, 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 { Faq54, faq54Demo } from "@/components/blocks/faq/faq54";

export default function Page() {
  return <Faq54 {...faq54Demo} />;
}

Props

PropTypeDefaultDescription
badgestringnoneOptional small uppercase label above the heading.
headingstringnoneSection heading.
descriptionstringundefinedOptional supporting copy under the heading.
categoriesFaqCategory[]noneOrdered list of category tabs, each with its own set of question and answer entries.
classNamestringnoneExtra classes for the outer section element.

Types

type QaItem = { question: string; answer: string };

type FaqCategory = {
  label: string;
  items: QaItem[];
};

Behavior notes

  • Real interactivity: clicking a category tab in the left column updates the active index in state, swapping the entire right panel's list of Q&A entries.
  • The first category is active by default; tabs expose role="tab"/aria-selected and the panel uses role="tabpanel".
  • Entries within the active category are all shown open at once, there is no nested accordion on top of the category switch.
  • The tab list scrolls horizontally on small screens and stacks vertically from the sm breakpoint up.