Skip to main content
Menu
On this page

Embed a form in documentation

Add a compact article-feedback form with native, accessible controls to your docs, with the page path stored beside each answer.

Put article feedback at the end of the content it's about, and store the page path beside a small, focused answer.

Define one useful question

Code
const articleFeedback = defineForm({
  id: "article-feedback",
  title: "Was this helpful?",
  pages: [{
    id: "feedback",
    blocks: [
      { id: "path", kind: "hidden", label: "Article path", paramName: "path" },
      {
        id: "helpful",
        kind: "select",
        label: "Was this helpful?",
        required: true,
        options: [
          { id: "yes", label: "Yes", icon: "thumbs_up" },
          { id: "no", label: "No", icon: "thumbs_down" },
        ],
      },
      {
        id: "detail",
        kind: "long_text",
        label: "What should we improve?",
        visibleIf: [{ fieldId: "helpful", op: "eq", value: "no" }],
      },
    ],
  }],
  settings: { submitLabel: "Send feedback", successTitle: "Thanks" },
});

Render it in the article footer

tsx
<FilloForm
  form={articleFeedback}
  client={client}
  initialData={{ path: window.location.pathname }}
  showTitle={false}
/>

If your documentation framework renders on the server, pass the route from framework data instead of reading window during server render. And keep a visible section heading, so hiding the renderer title doesn't leave the question without context.

Protect signal quality

For light repeat friction, scope a browser response limit by path; for signed-in docs, use verified identity. Browser limits can be bypassed. Read negative feedback alongside the page path, and don't treat a visitor-supplied hidden path as authoritative.

Try it

Start with a prompt and your coding agent builds the first form, staged for your review — or open the editor.

Updated

Was this page helpful?