Tabbed Categories
A left sidebar of category buttons with active-state styling, paired with a right-hand accordion that swaps to the selected category's questions. Good for FAQ pages with enough content to warrant grouping by topic.
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/tabbed-categories.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/faq/faq10.tsx instead.
Usage
The file also exports faq10Demo, 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 { Faq10, faq10Demo } from "@/components/blocks/faq/faq10"; export default function Page() { return <Faq10 {...faq10Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Frequently asked questions" | Section heading. |
| description | string | undefined | Optional supporting copy under the heading. |
| categories | Faq10Category[] | none | Ordered list of category tabs, each with its own list of question and answer entries. |
| className | string | none | Extra classes for the outer section element. |
Types
type Faq10Item = { question: string; answer: string }; type Faq10Category = { label: string; items: Faq10Item[]; };
Behavior notes
- Real interactivity: clicking a sidebar category button switches the active category in state, which swaps the entire accordion list on the right.
- The accordion on the right has its own open/close state per item, single-open-at-a-time; switching categories resets it to fully collapsed rather than trying to preserve which index was open.
- The sidebar becomes a horizontally scrolling row below the lg breakpoint and a vertical stack above it.
- The first category is active and its accordion starts fully collapsed on initial render.
More FAQ Blocks
View all →collapsible-accordion
Collapsible Accordion
Stacked cards with expandable sections, for full-length answers in a compact format.
open-list-layout
Open List Layout
Questions with answers displayed directly below in a simple always-open list.
three-column-grid
Three Column Grid
Q&A pairs arranged in a responsive grid layout, always open.
searchable-accordion
Searchable Accordion
Search input that filters accordion items in real-time by question and answer text.
grouped-sections
Grouped Sections
FAQs organized into titled sections, each with its own independent accordion below it.
side-by-side-image
Side-by-Side Image
Accordion paired with a large image on the left or right.