Skip to content
English

Usage

import { DocsFeedback } from './DocsFeedback.jsx'

// Post the answer to your feedback route; resolve false to show the error and keep the answer.
// After Yes, a tap on what helped most is sent again with followUp: true.
<DocsFeedback
  locale="en"
  onSend={async (answer) => {   // { helpful, reasons, comment, followUp? }
    const res = await fetch('/api/feedback', { method: 'POST', body: JSON.stringify({ page: slug, ...answer }) })
    return res.ok
  }}
/>

Props

PropTypeDefaultWhat it does
locale'en' | 'zh-CN' | 'es' | 'ja''en'Language of the built-in text and reasons.
reasonsArray<{ value, label }>sample reasonsThe reasons offered after No. An empty array leaves only the comment.
likedArray<{ value, label }>sample answersWhat could have helped, offered after Yes; a tap sends { helpful: true, reasons: [value], followUp: true }. An empty array hides the follow-up.
linksArray<{ label, href, icon? }>sample linksOther ways to help, in the foot beside the "updated" line (labels.updated). An empty array hides them.
maxLengthnumber500Longest comment, shown as a count under the field.
defaultValue'yes' | 'no' | nullnullThe answer it starts with; "no" opens the form.
loading / errorboolean / boolean | stringfalseShow the skeleton, or the error banner with "Send again" (a string replaces its sentence).
onSend / onRetry(answer) => Promise<boolean | void> / () => void—Sends { helpful, reasons, comment }; resolve false (or throw) to show the error. onRetry runs before sending again.
labelsobject—Replaces any built-in text (keys as in copy.js).

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.

DocsFeedback.jsxdocs-feedback.csscopy.jskit.jsxkit.cssui/base-button/ui/two-step-button/ui/alert-banner/ui/success-check/ui/chip-group/ui/textarea/ui/skeleton-shimmer/tokens.cssREADME.md

The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.