# FAQ Section

> A React FAQ section for marketing pages: an accordion, a split layout, an open grid or expandable cards, with topics and live search.

- Type: React block (Marketing Sections)
- Access: Free (the source is open to everyone)
- Version: 1.0.0
- Install: `npx wingo-ui@latest add faq-section`
- Docs: https://wingo-ui.com/components/faq-section

## Interaction

Click or tap a question to open its answer (Enter and Space on the keyboard, arrow keys move between questions); in single mode opening one closes the other. The topics row filters the list: on phones it scrolls sideways, arrows move between topics. With search on, typing filters questions and answers live, opens every answer that holds the words and marks each match; when nothing matches, an empty state offers to search all topics or contact the team. Links inside answers are underlined. In the split layout the heading and contact card stay in view while the questions scroll on desktop. The grid layout shows every answer at once, one column on phones. The cards layout gives each question its own raised card that expands in place (a button with aria-expanded controlling its answer region), topic chips with counts on top, two columns from 768px and one on phones.

## Installation

```bash
npx wingo-ui@latest add faq-section
```

The CLI adds the files, their dependencies and a version record for updates.

With shadcn: `npx shadcn@latest add https://wingo-ui.com/r/faq-section.json`

Files:

- `components/blocks/faq-section.tsx`

npm dependencies: `npm i motion lucide-react`

Wingo UI dependencies (installed automatically):

- [Marketing Section](https://wingo-ui.com/components/marketing-section) ([Markdown](https://wingo-ui.com/components/marketing-section.md))
- [Accordion](https://wingo-ui.com/components/accordion) ([Markdown](https://wingo-ui.com/components/accordion.md))
- [Button](https://wingo-ui.com/components/button) ([Markdown](https://wingo-ui.com/components/button.md))
- [Search Input](https://wingo-ui.com/components/search-input) ([Markdown](https://wingo-ui.com/components/search-input.md))
- [Segmented Control](https://wingo-ui.com/components/segmented-control) ([Markdown](https://wingo-ui.com/components/segmented-control.md))
- [useControllableState](https://wingo-ui.com/components/use-controllable-state) ([Markdown](https://wingo-ui.com/components/use-controllable-state.md))
- [Motion presets](https://wingo-ui.com/components/motion) ([Markdown](https://wingo-ui.com/components/motion.md))
- [Navigation](https://wingo-ui.com/components/navigation) ([Markdown](https://wingo-ui.com/components/navigation.md))
- [Tones](https://wingo-ui.com/components/tones) ([Markdown](https://wingo-ui.com/components/tones.md))
- [UIProvider](https://wingo-ui.com/components/ui-config) ([Markdown](https://wingo-ui.com/components/ui-config.md))

## Usage

```tsx
// app/(marketing)/faq/page.tsx
"use client"

import Link from "next/link"
import { FaqSection, FAQ_SECTION_CATEGORIES, type FaqItem } from "@/components/blocks/faq-section"

const questions: FaqItem[] = [
  { category: "billing", question: "Can I cancel at any time?", answer: "Yes. You keep access until the end of the billing period." },
  {
    category: "account",
    question: "How do I invite my team?",
    answer: (
      <>
        Open Settings, then Members. <Link href="/docs/members">Read the guide</Link>.
      </>
    ),
  },
]

export default function FaqPage() {
  return (
    <FaqSection
      headingAs="h1"
      items={questions}
      categories={FAQ_SECTION_CATEGORIES}
      searchable
      jsonLd
      linkComponent={Link}
    />
  )
}
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `eyebrow?` | `ReactNode` | `"FAQ"` | The small uppercase line over the title. |
| `title?` | `ReactNode` | `"Frequently asked questions"` | The section title. |
| `description?` | `ReactNode` | `"Everything about plans, your account and your data. Can't find an answer? We are one message away."` | The muted paragraph under the title. |
| `actions?` | `ReactNode` |  | Buttons under the description. |
| `items?` | `FaqItem[]` | `"FAQ_SECTION_SAMPLE"` | { question, answer, answerText?, category?, id? }; answer is any node, links in it are underlined. |
| `categories?` | `FaqCategory[]` | `"FAQ_SECTION_CATEGORIES"` | { value, label, icon? } topics; only topics that hold a question show, and the row hides below two. In the cards layout they show as chips and as a label on each card. |
| `showCategories?` | `boolean` | `true` | The topics row that filters the list. |
| `category?` | `string` |  | The selected topic (controlled); "all" or a category value. |
| `defaultCategory?` | `string` | `"all"` | The topic selected at first. |
| `onCategoryChange?` | `(category: string) => void` |  | Runs when a topic is picked. |
| `searchable?` | `boolean` | `false` | A search field that filters questions and answers as you type and marks the matches. |
| `layout?` | `"centered" \| "split" \| "grid" \| "cards"` | `"centered"` | centered: one 720px column; split: heading and contact card on the left (sticky on desktop); grid: two columns, always open; cards: a raised card per question in two columns that opens in place, with topic chips and counts on top. |
| `type?` | `"single" \| "multiple"` | `"single"` | single: one answer open at a time; multiple: any number. |
| `defaultOpen?` | `boolean` | `true` | The first question starts open. |
| `variant?` | `"ghost" \| "outline" \| "soft" \| "separated"` | `"ghost"` | The accordion look: hairlines, one outlined or tinted box, or a card per question. |
| `indicator?` | `"chevron" \| "plus" \| "none"` | `"plus"` | The open / closed sign at the end of each question (in the cards layout a round badge that fills with the tone when open). |
| `tone?` | `"neutral" \| "brand" \| "success" \| "warning" \| "danger" \| "info"` | `"neutral"` | The selected topic, the open question's sign and the contact button. |
| `contact?` | `boolean` | `true` | The "Still have questions?" card. |
| `contactHref?` | `string` | `"/contact"` | Where the contact buttons link. |
| `jsonLd?` | `boolean` | `false` | Adds a FAQPage JSON-LD script with the plain text of every answer, for rich results in search. |
| `align?` | `"start" \| "center"` | `"center"` | Where the heading sits (split always starts). |
| `headingSize?` | `"md" \| "lg"` | `"md"` | lg when the section opens the page (a FAQ page). |
| `headingAs?` | `"h1" \| "h2" \| "h3"` | `"h2"` | The title element: h1 on a FAQ page, h2 inside a longer page. |
| `width?` | `"auto" \| "sm" \| "md" \| "lg" \| "xl"` | `"auto"` | The column; auto picks by layout (centered sm 720px, the others lg 1200px). |
| `background?` | `"none" \| "muted"` | `"none"` | muted: a gray band that sets the section apart. |
| `spacing?` | `"none" \| "sm" \| "md" \| "lg"` | `"md"` | Vertical padding, from MarketingSection. |
| `linkComponent?` | `(props: LinkComponentProps) => ReactNode` | `"\"a\""` | The router link (or "a") for the contact buttons; default the LinkProvider's (links inside answers use the provider). |
| `labels?` | `Partial<FaqSectionLabels>` |  | all, categories, searchLabel, searchPlaceholder, empty ({query}), emptyDescription, searchAll, contactTitle, contactDescription, contactAction. |
| `className?` | `string` |  | Classes for the <section>. |
| `classNames?` | `Partial<Record<FaqSectionSlot, string>>` |  | Classes for heading, aside, toolbar, categories, search, list, item, question, answer, empty and contact. |

## Parts

### FAQ_SECTION_SAMPLE (constant)

Twelve Acme questions across billing, account, security and integrations.

### FAQ_SECTION_CATEGORIES (constant)

The four sample topics: Billing, Account, Security, Integrations.

### DEFAULT_FAQ_SECTION_LABELS (constant)

The English strings.

### faqNodeText (function)

The plain text of a node: what search and the JSON-LD read from a rich answer.

### FaqItem (type)

{ question, answer, answerText?, category?, id? }.

### FaqCategory (type)

{ value, label, icon? }.

### FaqSectionProps (type)

Props of FaqSection.

## Examples

- **Help center with search**: Topics and a search field that filters as you type and marks every match.
- **Split, with the contact card**: The heading and a sticky contact card on the left, the questions on the right.
- **Always open grid**: Two columns of short answers with no accordion, on a muted band.
- **Pricing FAQ, brand tone**: Only the billing questions, several open at once, with a FAQPage JSON-LD script for search engines.
- **Question cards**: Each question on its own card that opens in place, with topic chips and counts on top.

## See also

- [Accordion](https://wingo-ui.com/components/accordion) ([Markdown](https://wingo-ui.com/components/accordion.md))
- [Marketing Section](https://wingo-ui.com/components/marketing-section) ([Markdown](https://wingo-ui.com/components/marketing-section.md))
- [Search Input](https://wingo-ui.com/components/search-input) ([Markdown](https://wingo-ui.com/components/search-input.md))
- [Segmented Control](https://wingo-ui.com/components/segmented-control) ([Markdown](https://wingo-ui.com/components/segmented-control.md))
- [Pricing Page](https://wingo-ui.com/components/pricing-page) ([Markdown](https://wingo-ui.com/components/pricing-page.md))

---

Canonical: https://wingo-ui.com/components/faq-section
More components: https://wingo-ui.com/components · Index for agents: https://wingo-ui.com/llms.txt
