Minimal Plus-Minus
A distraction-free single-column FAQ accordion. No cards, no shadows, just hairline dividers between rows and a Plus icon that swaps to Minus when a row is expanded. Only one row is open at a time.
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/minimal-plus-minus.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/faq/faq34.tsx instead.
Usage
The file also exports faq34Demo, 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 { Faq34, faq34Demo } from "@/components/blocks/faq/faq34"; export default function Page() { return <Faq34 {...faq34Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Frequently asked questions" | Section heading. |
| description | string | none | Optional supporting copy under the heading. |
| items | { question: string; answer: string }[] | none | Accordion rows. |
| defaultOpenIndex | number | 0 | Index of the row expanded on initial render (pass a value out of range, e.g. -1, to start fully collapsed). |
| className | string | none | Extra classes for the outer section element. |
Behavior notes
- Real client-side accordion state: clicking a question's button toggles real open/closed state and swaps the Plus/Minus icon, only one row is expanded at a time, expanding a new row collapses whichever was previously open.
- Each question is a genuine <button type="button"> with aria-expanded and aria-controls wired to the answer panel's id, and the panel carries role="region" with aria-labelledby back to the button.
- Demo props live in a separate faq34.demo.tsx file (no "use client") since this is a client component, per the repo's block-preview prop-passing convention.
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.
tabbed-categories
Tabbed Categories
Sidebar navigation with category tabs and an accordion of that category's questions.
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.