# FAQ Search

> Help-centre FAQ: a large search field filters answers live and highlights the matched words, a 2×3 grid of topic cards shows how many answers match in each, and results open as a divided accordion. Every answer ends with a thumbs up or down that confirms inline, and an empty search offers to contact support.

- Slug: `faq-search`
- Category: [FAQs](https://www.assembli.design/category/faqs.md)
- Type: block
- Tags: faq, search, help-centre, accordion, feedback, highlight
- npm dependencies: @base-ui/react, lucide-react
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/faq-search
- Page: https://www.assembli.design/components/faq-search

![FAQ Search preview](https://www.assembli.design/thumbnails/faq-search-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `eyebrow` | `React.ReactNode` | `"Help centre"` |  |
| `title` | `React.ReactNode` | `"How can we help?"` |  |
| `description` | `React.ReactNode` |  |  |
| `topics` (required) | `FaqSearchTopic[]` |  |  |
| `items` (required) | `FaqSearchItem[]` |  |  |
| `suggestions` | `string[]` | `[]` | Quick searches offered under the field. |
| `placeholder` | `string` | `"Search answers…"` |  |
| `supportHref` | `string` | `"#"` | Where "Contact support" goes. `{query}` is replaced with the search text. |
| `popular` | `string[]` |  | Ids shown as "Popular questions" before anyone searches or picks a topic. Defaults to every answer. |
| `defaultOpen` | `string[]` | `[]` | Answers open on first render. |
| `onFeedback` | `(id: string, vote: FaqSearchVote) => void` |  | Called when someone rates an answer. |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/faq-search/faq-search.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/faq-search
```

Registry item JSON: https://www.assembli.design/r/faq-search.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
