Usage
import { LandingFaq } from './LandingFaq.jsx'
// Without onAsk a question is "sent" after a short wait. Wire it to your help desk:
<LandingFaq
locale="en"
topics={[{ id: 'water', name: 'Watering' }]}
items={faq} // [{ id, topic, q, a }]
loading={!faq}
error={faqError}
onRetry={reloadFaq}
onAsk={async (question) => (await sendQuestion(question)).ok}
onFeedback={(id, helpful) => track('faq-helpful', { id, helpful })}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text and sample questions. |
topics | Array<{ id, name }> | sample topics | The topics shown as filters, in order; “All” comes first by itself. |
items | Array<{ id, topic, q, a }> | sample questions | The questions and their answers. An empty array shows the empty state with a way to ask. |
defaultQuery | string | '' | Text the search starts with, for example from a link. |
loading | boolean | false | Shows the skeleton of the questions while they load. |
error | boolean | string | false | Shows the error banner with a retry button; a string replaces its sentence. |
onAsk | (question) => Promise<boolean | void> | — | Sends a question. Resolve false to keep the form open; otherwise it shows as sent. |
onFeedback | (id, helpful) => void | — | A visitor said whether an answer helped. |
onSearch / onRetry | (query) => void / () => void | — | The search changed; the error banner’s retry was pressed. |
labels | object | — | Replaces any built-in text (keys as in copy.js). |
className | string | — | Added to the root section. |
Add it to your project
Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the block together with the components it is built from.
LandingFaq.jsxlanding-faq.csscopy.jskit.jsxkit.cssui/base-button/ui/empty-state/ui/alert-banner/ui/success-check/ui/text-input/ui/textarea/ui/skeleton-shimmer/ui/smooth-accordion/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.