Skip to content

blocks/faq-chat

FaqChatEntry = object

One reviewed question and its fixed answer.

id: string

Stable identity for the entry.

question: string

The question as a visitor would ask it. Also shown as a suggestion.

answer: ReactNode

The reviewed answer. The chat never generates text of its own.

optional keywords?: readonly string[]

Lowercase words or phrases that route a typed question here.

optional actions?: ReactNode

Caller-owned next steps shown under the answer, such as links.


FaqChatFallback = object

The reply for a typed question that matches no entry.

answer: ReactNode

optional actions?: ReactNode


FaqChatProps = Omit<HTMLAttributes<HTMLElement>>, "title"> > & object

Props accepted by FaqChat.

entries: readonly FaqChatEntry[]

greeting: ReactNode

The first agent message, shown before any question.

fallback: FaqChatFallback

title: ReactNode

Visible heading and accessible name of the chat.

optional note?: ReactNode

A short honest note about where answers come from.

optional avatar?: ReactNode

Optional mark shown beside the title, such as a logo.

optional inputLabel?: string

Accessible label of the typed-question field.

optional placeholder?: string

optional submitLabel?: string

const FaqChat: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>>, "title"> > & object & RefAttributes<HTMLElement>>>>

A chat-shaped FAQ. Visitors pick or type a question and get the caller’s reviewed answer with its next steps. Message rows follow Parakeet: the visitor’s turn sits on the surface with a primary rule, the answer is plain.

matchFaqEntry(entries, text): FaqChatEntry | undefined

Routes a typed question to the entry whose keywords it mentions most. Returns undefined when nothing matches, so the caller can answer honestly.

readonly FaqChatEntry[]

string

FaqChatEntry | undefined