# FAQ accordion

Expandable questions and answers with keyboard navigation.

Access: pro. Category: Essentials. Kind: primitive.

## When to use

- Use it when a product interface needs expandable questions and answers with keyboard navigation.
- Choose it when the host application can supply the required state and keep business logic outside the presentation component.

## Alternatives

- Choose tidal-button instead when press, loading, success and disabled states is the actual interface need, rather than faq accordion.

## 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 accordion

```sh
npx shadcn@latest add @tidal-pro/accordion
```

Stylesheets: `components/ui/tidal.css`, `components/ui/accordion.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/accordion.css";
import{TidalAccordion}from"./components/ui/accordion";
export default()=><div className="tidal-scope"><TidalAccordion items={[{value:"value",title:"Demo",content:"value"}]} label={"Demo"} onValueChange={() => {}} value={"value"}/></div>;
```

## Structured props

- `TidalAccordion.items: Array<TidalAccordionItem>`: Required items value accepted by this exported component.
- `TidalAccordion.label: string`: Required label value accepted by this exported component.
- `TidalAccordion.onValueChange: ((value: string) => void) | ((value: string[]) => void)`: Callback invoked when the value change interaction is proposed.
- `TidalAccordion.value: string | Array<string>`: Required value value accepted by this exported component.
- `TidalAccordion.className?: string | undefined`: Optional class name value accepted by this exported component.
- `TidalAccordion.collapsible?: boolean | undefined`: Optional collapsible value accepted by this exported component.
- `TidalAccordion.disabled?: boolean | undefined`: Optional disabled value accepted by this exported component.
- `TidalAccordion.headingLevel?: 2 | 3 | 4 | 5 | 6 | undefined`: Optional heading level value accepted by this exported component.
- `TidalAccordion.mode?: "multiple" | "single" | undefined`: Optional mode value accepted by this exported component.

## Complete usage example

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

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

import { TidalAccordion } from "./components/ui/accordion";

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

import { LayoutGrid } from "lucide-react";

import { UsersRound } from "lucide-react";

import { useState } from "react";

import { Settings } from "lucide-react";



const tidalExampleStyles = ".accordion-specimen{width:100%;max-width:425px;background:var(--t-surface);border:1px solid var(--t-border);border-radius:17px;padding:27px;box-shadow:0 8px 24px #1f1f1f07}.accordion-specimen>.demo-eyebrow{font-size:11px}.accordion-specimen>h3{font-size:26px;letter-spacing:-.9px;color:var(--t-ink);line-height:1.15;margin:13px 0 25px}\n.accordion-specimen{max-width:780px;padding:30px;border-radius:var(--t-radius-card);box-shadow:0 24px 40px -28px #00000035,0 2px 4px #00000008}@media(max-width:650px){.accordion-specimen{padding:24px}}\n.accordion-specimen{width:100%;max-width:620px}.accordion-specimen>.tidal-accordion{width:100%}";

export function AccordionDemo() {
  const [question, setQuestion] = useState("start");
  const topics = [
    {
      value: "start",
      title: "Where do I begin?",
      icon: LayoutGrid,
      detail: "Choose one useful detail.",
      content: (
        <p>
          Start with a component that solves a real need. Preview it, then
          follow the <a href="/docs">installation guide</a> to bring its source
          and styles into your project.
        </p>
      ),
    },
    {
      value: "agents",
      title: "Can my agent build with it?",
      icon: UsersRound,
      detail: "Give your agent the right context.",
      content: (
        <p>
          The <a href="/docs/agents">agent guide</a> includes the machine
          catalog, component APIs and registry instructions. Free components are
          public; Pro source requires an active entitlement.
        </p>
      ),
    },
    {
      value: "custom",
      title: "Can I customize the components?",
      icon: Settings,
      detail: "Make the details your own.",
      content: (
        <p>
          Adjust the scoped CSS tokens, edit the React source and connect your
          own data. Keep the keyboard behavior, visible focus and reduced-motion
          support as you make it your own.
        </p>
      ),
    },
  ];
  return (
    <div className="accordion-specimen">
      <TidalAccordion
        label="Frequently asked questions"
        value={question}
        onValueChange={setQuestion}
        headingLevel={3}
        items={topics}
      />
    </div>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <AccordionDemo />
    </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."}

Controlled label, items ({value,title,content:ReactNode,Lucide icon?,disabled?}[]), value, onValueChange. Single mode uses string and optional collapsible (default true); multiple mode uses string[]. Optional disabled, className, headingLevel2–6(default3). Unique nonempty item values. Radix ArrowUp/Down/Home/End, Enter/Space disclosure, linked regions, disabled skipping. Closed panels unmount their children after the exit animation. Lift persistent form state above the accordion. A shared marker follows the open item in single mode; multiple mode marks each open row. Consumer owns content.
