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/grouped-sections.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/faq/faq12.tsx instead.
Usage
The file also exports faq12Demo, 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 { Faq12, faq12Demo } from "@/components/blocks/faq/faq12"; export default function Page() { return <Faq12 {...faq12Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Frequently asked questions" | Section heading. |
| description | string | undefined | Optional supporting copy under the heading. |
| sections | Faq12Section[] | none | Ordered list of titled sections, each with its own list of question and answer entries. |
| className | string | none | Extra classes for the outer section element. |
Types
type Faq12Item = { question: string; answer: string }; type Faq12Section = { title: string; items: Faq12Item[]; };
Behavior notes
- Real interactivity: each section renders its own independent accordion with its own open/close state, single-open-at-a-time within that section only.
- Sections are fully independent of one another, opening an item in one section never affects any other section's state.
- Sections stack vertically with generous spacing (space-y-12) and each has its own heading above its accordion.
More FAQ Blocks
View all →Collapsible Accordion
Stacked cards with expandable sections, for full-length answers in a compact format.
Open List Layout
Questions with answers displayed directly below in a simple always-open list.
Three Column Grid
Q&A pairs arranged in a responsive grid layout, always open.
Tabbed Categories
Sidebar navigation with category tabs and an accordion of that category's questions.
Searchable Accordion
Search input that filters accordion items in real-time by question and answer text.
Side-by-Side Image
Accordion paired with a large image on the left or right.