# FAQ: two-column exclusive accordion

> Heading and support link on the left, an exclusive animated accordion of questions on the right, built on native details.

- Kind: block · Category: FAQ · Interactivity: native
- Install: `npx shadcn@latest add @haze/faq-accordion`
- File: `src/components/haze/blocks/faq-accordion.astro`
- npm dependencies: none
- Registry dependencies: @haze/accordion
- Docs page: https://hazeui.com/blocks/faq-accordion

## Use when
- Answering five to ten pre-sales or billing questions
- You need an accordion with zero JavaScript

## Avoid when
- Answers are long articles; link to a help center instead
- Users need to compare all answers at once; show them expanded

## Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| title | `string` | "Frequently asked questions" | no | Section heading (h2). |
| description | `string` | demo copy | no | Text before the support link. |
| contactHref | `string` | "#contact" | no | Target of the Contact support link. |
| groupName | `string` | "haze-faq" | no | Shared details name; makes only one item open at a time. |
| items | `{ question: string; answer: string }[]` | 5 demo questions | no | Questions and answers. |

## Accessibility
- Native <details>/<summary> gives button semantics and expanded state without ARIA.
- Answers stay in the DOM, so in-page search can find and open them in supporting browsers.
- Key Enter / Space: Open or close the focused question

## Agent prompts

### Install and use

Install the Haze UI block "FAQ: two-column exclusive accordion" with `npx shadcn@latest add @haze/faq-accordion`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import FaqAccordion from "@/components/haze/blocks/faq-accordion.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/faq-accordion.md

### Customize with real content

Adapt the Haze faq-accordion block for our product. Replace the demo values of these props with our real content: title, description, contactHref, groupName, items. Keep the layout, the heading level rules and these accessibility details: Native <details>/<summary> gives button semantics and expanded state without ARIA. Answers stay in the DOM, so in-page search can find and open them in supporting browsers. Do not add raw color classes; use the Haze tokens.

### Choose the right block

Before using faq-accordion, check it fits: use it when answering five to ten pre-sales or billing questions; you need an accordion with zero javascript. Avoid it when answers are long articles; link to a help center instead; users need to compare all answers at once; show them expanded.

## Example requests that should lead here
- Add an FAQ section with an accordion where only one answer is open at a time
- Two column FAQ with a contact support link

## Source

```astro
---
import Accordion from "../ui/accordion.astro";

interface Props {
  title?: string;
  description?: string;
  /** Target of the "Contact support" link. Pass an empty string to hide the link. */
  contactHref?: string;
  /** Shared name makes the accordion exclusive (one item open at a time). Set a unique value per FAQ on the page. */
  groupName?: string;
  items?: { question: string; answer: string }[];
}

const {
  title = "Frequently asked questions",
  description = "Can't find what you're looking for?",
  contactHref = "#contact",
  groupName = "haze-faq",
  items = [
    { question: "Can I import my data from another tool?", answer: "Yes. Importers for the most common issue trackers bring over issues, comments, labels and assignees. Most workspaces finish importing in under five minutes." },
    { question: "Is there a free plan?", answer: "The Free plan covers up to three members with unlimited issues. You only pay when the team grows or you need automations." },
    { question: "How does billing work for new members?", answer: "Members are billed pro rata from the day they join. Removing someone credits the unused time to your next invoice." },
    { question: "Where is my data stored?", answer: "In the EU or the US, chosen when you create the workspace. All data is encrypted at rest and in transit." },
    { question: "Do you offer discounts for non-profits?", answer: "Registered non-profits and open-source projects get the Team plan at half price. Contact us with proof of status." },
  ],
} = Astro.props;

const accordionItems = items.map((item) => ({ title: item.question, content: item.answer }));
---

<section aria-labelledby="faq-accordion-title" class="bg-background px-6 py-20 sm:py-24">
  <div class="mx-auto grid max-w-6xl gap-10 lg:grid-cols-[1fr_2fr] lg:gap-16">
    <div>
      <h2 id="faq-accordion-title" class="text-3xl/9 font-semibold tracking-tight text-balance text-foreground sm:text-4xl/11">{title}</h2>
      <p class="mt-4 text-base/7 text-pretty text-muted-foreground">
        {description}
        {
          contactHref && (
            <>
              <a href={contactHref} class="rounded-sm font-medium text-foreground underline underline-offset-4 transition-colors duration-150 ease-snappy hover:text-foreground/80 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring">Contact support</a>.
            </>
          )
        }
      </p>
    </div>
    <Accordion items={accordionItems} name={groupName} variant="plain" icon="plus" />
  </div>
</section>
```
