Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its input, label dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/live-search-faq.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/faq/faq85.tsx instead.
Usage
The file also exports faq85Demo, 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 { Faq85, faq85Demo } from "@/components/blocks/faq/faq85"; export default function Page() { return <Faq85 {...faq85Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| badge | string | none | Small eyebrow label above the heading. |
| heading | string | none | Section heading. |
| description | string | none | Section intro text. |
| searchPlaceholder | string | "Search questions..." | Placeholder text on the search input. |
| entries | FaqEntry[] | none | Full FAQ list; the search input filters this array by topic, question, and answer. |
| className | string | none | Extra classes for the outer section element. |
Types
type FaqEntry = { topic: string; question: string; answer: string; };
Behavior notes
- "use client" because the search input is a real controlled field: typing filters the visible entries via local state and a useMemo derivation, case-insensitively, across the topic, question, and answer fields.
- Every matching entry renders fully expanded on its own hairline row; there is no accordion collapse here, the search itself is the narrowing mechanism.
- An empty state message renders in place of the list when the query matches zero entries.
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.
Grouped Sections
FAQs organized into titled sections, each with its own independent accordion below it.