Skip to content
English

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

PropTypeDefaultWhat it does
locale'en' | 'zh-CN' | 'es' | 'ja''en'Language of the built-in text and sample questions.
topicsArray<{ id, name }>sample topicsThe topics shown as filters, in order; “All” comes first by itself.
itemsArray<{ id, topic, q, a }>sample questionsThe questions and their answers. An empty array shows the empty state with a way to ask.
defaultQuerystring''Text the search starts with, for example from a link.
loadingbooleanfalseShows the skeleton of the questions while they load.
errorboolean | stringfalseShows 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.
labelsobject—Replaces any built-in text (keys as in copy.js).
classNamestring—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.