Staaarter

Grouped Sections

Multiple named sections, such as Billing, Account, and Security, each with its own heading and its own independent accordion of questions underneath. Good for FAQ pages covering several distinct topics.

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/grouped-sections.json

Prefer 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

PropTypeDefaultDescription
headingstring"Frequently asked questions"Section heading.
descriptionstringundefinedOptional supporting copy under the heading.
sectionsFaq12Section[]noneOrdered list of titled sections, each with its own list of question and answer entries.
classNamestringnoneExtra 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.