# FAQ section

A searchable, categorized FAQ section composed from the controlled FAQ accordion primitive.

Access: pro. Category: Marketing. Kind: section.

## When to use

- Use it when a page needs a searchable, categorized faq section composed from the controlled faq accordion primitive.
- Choose it as the faq region when composing a page from independently reusable TidalUI sections.

## Alternatives

- Choose feature-card instead when a feature summary with animated orbital artwork is the actual interface need, rather than faq section.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install FAQ section

```sh
npx shadcn@latest add @tidal-pro/faq-section
```

Stylesheets: `components/ui/tidal.css`, `components/ui/faq-section.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/faq-section.css";
import{TidalFaqSection}from"./components/ui/faq-section";
export default()=><div className="tidal-scope"><TidalFaqSection groups={[{id:"example",label:"Demo",questions:[{answer:"value",value:"value",title:"Demo"}]}]} onValueChange={() => {}} title={"Demo"} value={"value"}/></div>;
```

## Structured props

- `TidalFaqSection.groups: ReadonlyArray<TidalFaqGroup>`: Required groups value accepted by this exported component.
- `TidalFaqSection.onValueChange: (value: string) => void`: Callback invoked when the value change interaction is proposed.
- `TidalFaqSection.title: ReactNode`: Required title value accepted by this exported component.
- `TidalFaqSection.value: string`: Required value value accepted by this exported component.
- `TidalFaqSection.category?: TidalFaqCategoryControl | undefined`: Optional category value accepted by this exported component.
- `TidalFaqSection.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalFaqSection.emptyMessage?: ReactNode` (default "No questions match this view."): Optional empty message value accepted by this exported component.
- `TidalFaqSection.eyebrow?: ReactNode` (default "Frequently asked questions"): Optional eyebrow value accepted by this exported component.
- `TidalFaqSection.footer?: ReactNode`: Optional footer value accepted by this exported component.
- `TidalFaqSection.headingLevel?: "h2" | "h3" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalFaqSection.reset?: TidalFaqResetControl | undefined`: Optional reset value accepted by this exported component.
- `TidalFaqSection.resultLabel?: ((count: number) => ReactNode) | undefined` (default (count) =>
        `${count} ${count === 1 ? "question" : "questions"}`): Optional result label value accepted by this exported component.
- `TidalFaqSection.search?: TidalFaqSearchControl | undefined`: Optional search value accepted by this exported component.
- `TidalFaqSection.summaryHint?: ReactNode`: Optional summary hint value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/faq-section.tsx) | [Manifest](https://tidalui.com/examples/faq-section.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useState } from "react";

import { BookOpen, Braces, CreditCard, FolderOpen, Keyboard, LockKeyhole, Palette, RefreshCw, Users } from "lucide-react";

import { TidalFaqSection, type TidalFaqGroup } from "./components/ui/faq-section";

import "./components/ui/faq-section.css";

import "./components/ui/accordion.css";



const tidalExampleStyles = ".tidal-scope .faq-section-demo,\n.tidal-scope .faq-section-demo * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .faq-section-demo {\n  width: 100%;\n  min-width: 0;\n  padding: clamp(10px, 3.2vw, 36px);\n  color: var(--t-ink);\n  background:\n    linear-gradient(var(--t-border) 1px, transparent 1px),\n    linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\n    var(--t-subtle);\n  background-size: 27px 27px;\n  border-radius: 24px;\n  container: faq-demo / inline-size;\n}\n\n.tidal-scope .faq-section-demo-shell {\n  display: grid;\n  width: 100%;\n  max-width: 1180px;\n  min-width: 0;\n  gap: 12px;\n  margin: 0 auto;\n}\n\n.tidal-scope .faq-section-demo-status {\n  min-height: 16px;\n  margin: 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.55;\n  text-align: center;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .faq-section-demo-note {\n  width: 100%;\n  max-width: 1120px;\n  min-width: 0;\n  margin: 0 auto;\n  padding: 15px 17px;\n  color: var(--t-ink);\n  background: var(--t-surface);\n  border: 1px solid var(--t-border);\n  border-radius: 18px;\n  scroll-margin-top: 16px;\n}\n\n.tidal-scope .faq-section-demo-note > * {\n  display: block;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .faq-section-demo-note > span {\n  color: var(--t-muted);\n  font-size: 11px;\n  font-weight: 690;\n  letter-spacing: 0.11em;\n}\n\n.tidal-scope .faq-section-demo-note > strong {\n  margin-top: 5px;\n  font-size: 13px;\n  line-height: 1.4;\n}\n\n.tidal-scope .faq-section-demo-note > p {\n  margin: 4px 0 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.6;\n}\n\n@container faq-demo (max-width: 440px) {\n  .tidal-scope .faq-section-demo {\n    padding: 6px;\n    background-size: 18px 18px;\n    border-radius: 18px;\n  }\n}\n.tidal-scope .faq-section-demo-link {\n  display: inline-flex;\n  min-width: 44px;\n  min-height: 44px;\n  max-width: 100%;\n  align-items: center;\n  padding-block: 8px;\n  color: var(--t-ink);\n  text-decoration: underline;\n  text-underline-offset: 4px;\n  overflow-wrap: anywhere;\n}";

type CategoryId = "all" | "starting" | "workflow" | "access";

const GROUPS: readonly TidalFaqGroup[] = [
  {
    id: "starting",
    label: "Getting started",
    description: "Install, style, and test the first sample component.",
    questions: [
      {
        value: "install",
        title: "How do I install a component?",
        searchText: "registry command files css styles dependency",
        icon: Braces,
        answer: (
          <div>
            <p>
              Copy the registry command from the component page and import its
              listed stylesheets.
            </p>
            <a className="faq-section-demo-link" href="#faq-demo-install-note">
              View installation note
            </a>
          </div>
        ),
      },
      {
        value: "sample-data",
        title: "Can I evaluate components with sample data?",
        searchText: "demo fictional local preview backend account",
        icon: FolderOpen,
        answer: (
          <p>
            Yes. TidalUI demos use clearly labelled fictional data and local
            React state. Replace the supplied records and handlers with your own
            application data when you integrate a component.
          </p>
        ),
      },
      {
        value: "keyboard",
        title: "What keyboard checks should I run?",
        searchText: "accessibility arrows home end tab enter space focus",
        icon: Keyboard,
        answer: (
          <p>
            Test Tab order, visible focus, Enter and Space activation, then the
            arrow, Home, and End behavior documented for the primitive. Repeat
            the flow at a narrow width and with reduced motion enabled.
          </p>
        ),
      },
    ],
  },
  {
    id: "workflow",
    label: "Project workflow",
    description: "Keep component changes legible inside a product codebase.",
    questions: [
      {
        value: "tokens",
        title: "Can I change the visual tokens?",
        searchText: "theme color radius typography monochrome css",
        icon: Palette,
        answer: (
          <p>
            Yes. Apply your values through the documented Tidal scope tokens so
            focus, contrast, and light or dark surfaces stay coordinated. Keep
            the component's state selectors intact.
          </p>
        ),
      },
      {
        value: "updates",
        title: "How should I review an update?",
        searchText: "upgrade diff source behavior regression",
        icon: BookOpen,
        answer: (
          <p>
            Read the source diff, repeat the component's native interaction
            path, and verify the widths your product actually supports. Treat a
            demo screenshot as visual evidence, not proof of your integration.
          </p>
        ),
      },
      {
        value: "state",
        title: "Who owns requests and saved state?",
        searchText: "network persistence storage server handlers controlled",
        icon: RefreshCw,
        answer: (
          <p>
            Your application does. Reusable TidalUI components expose native
            events and controlled values; consumers connect those requests,
            persistence rules, and result messages.
          </p>
        ),
      },
    ],
  },
  {
    id: "access",
    label: "Access and plans",
    description: "Understand source access without implying a transaction.",
    questions: [
      {
        value: "free-pro",
        title: "What is the difference between Free and Pro items?",
        searchText: "license registry source plan access",
        icon: CreditCard,
        answer: (
          <p>
            Free items expose their public registry source. Pro pages show the
            component contract and preview, while source access depends on the
            product plan selected by the consumer. This sample does not sell or
            unlock anything.
          </p>
        ),
      },
      {
        value: "team-use",
        title: "Can a team share the installed source?",
        searchText: "members workspace organization license",
        icon: Users,
        answer: (
          <p>
            Follow the license attached to the source package and your own
            repository access policy. This fictional FAQ does not grant or
            change a license.
          </p>
        ),
      },
      {
        value: "credentials",
        title: "Do the components need account credentials?",
        searchText: "secret token password api authentication",
        icon: LockKeyhole,
        answer: (
          <p>
            No credential is required to render a component. If your product
            connects a service, keep secrets on your backend and pass only the
            safe state and actions the interface needs.
          </p>
        ),
      },
    ],
  },
] as const;

const CATEGORY_OPTIONS = [
  { id: "all", label: "All" },
  { id: "starting", label: "Start" },
  { id: "workflow", label: "Workflow" },
  { id: "access", label: "Access" },
] as const;

export function FaqSectionDemo() {
  const [query, setQuery] = useState("");
  const [category, setCategory] = useState<CategoryId>("all");
  const [openQuestion, setOpenQuestion] = useState("sample-data");
  const [message, setMessage] = useState(
    "Showing all nine fictional questions. Sample data is open.",
  );

  function resetView() {
    setQuery("");
    setCategory("all");
    setOpenQuestion("sample-data");
    setMessage("FAQ sample reset. No account or request changed.");
  }

  return (
    <section className="faq-section-demo" aria-label="FAQ section preview">
      <div className="faq-section-demo-shell">
        <TidalFaqSection
          title="Frequently asked questions"
          summaryHint={null}
          eyebrow={null}
          description="Search the sample questions by topic."
          groups={GROUPS}
          value={openQuestion}
          onValueChange={(nextValue) => {
            setOpenQuestion(nextValue);
            setMessage(
              nextValue
                ? "A fictional FAQ answer was opened."
                : "The open FAQ answer was closed.",
            );
          }}
          search={{
            value: query,
            label: "Search questions",
            placeholder: "Search install, keyboard, access…",
            inputProps: { name: "faq-search", autoComplete: "off" },
            onValueChange: (nextQuery) => {
              setQuery(nextQuery);
              setMessage(
                nextQuery.trim()
                  ? `Showing local FAQ matches for “${nextQuery.trim()}”.`
                  : "FAQ search cleared.",
              );
            },
          }}
          category={{
            value: category,
            allId: "all",
            label: "Filter FAQ topics",
            options: CATEGORY_OPTIONS,
            onValueChange: (nextCategory) => {
              setCategory(nextCategory as CategoryId);
              setMessage(
                nextCategory === "all"
                  ? "Showing every fictional FAQ topic."
                  : `Showing the ${GROUPS.find((group) => group.id === nextCategory)?.label ?? "selected"} topic.`,
              );
            },
          }}
          reset={{ label: "Reset view", onReset: resetView }}
          emptyMessage="No fictional questions match those filters."
          footer={
            <span>Local preview. Search and filters stay in this page.</span>
          }
        />

        <p className="faq-section-demo-status" role="status" aria-live="polite">
          {message}
        </p>

        <aside id="faq-demo-install-note" className="faq-section-demo-note">
          <span>LOCAL INSTALLATION NOTE</span>
          <strong>
            Copy the command shown on the selected component page.
          </strong>
          <p>
            This same-page destination demonstrates a real native FAQ link. It
            does not install a package or change a project.
          </p>
        </aside>
      </div>
    </section>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <FaqSectionDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

title, consumer-owned groups, controlled accordion value, and onValueChange are required. Every group has a stable id, string label, optional description, and questions with globally unique nonempty values, string titles, ReactNode answers, optional plain searchText, Lucide icon, and disabled state. Optional search and category controls are fully controlled and compose native input/button handlers before higher callbacks; preventDefault suppresses the higher callback. Category counts respond to the current query. Optional reset is a persistent native button with attributes/ref and prevented-handler composition, so focus remains mounted after a reset even when no search or category control exists. Optional headingLevel, eyebrow, description, emptyMessage, resultLabel, summaryHint, footer, native section attributes/ref and labelling remain consumer-owned. The default summary instruction reflects the controls actually supplied. Search matches only question titles and supplied searchText, never stringifies answer nodes. The existing @tidal-pro/accordion registry dependency provides Arrow, Home, End, Enter and Space semantics, linked panels, disabled skipping and reduced motion. The section performs no request, storage, account, purchase, support, routing or persistence action.
