# Doc Feedback

> The footer at the end of a docs page: "Was this page helpful?" with Yes and No. Yes sends straight away; No opens reason chips and an optional note, sends through your async handler with a retry on failure, and settles into a thank-you. Edit this page, Last updated and Previous / Next cards with section labels sit beside it. An inline variant fits the end of a section.

- Slug: `doc-feedback`
- Category: [Code](https://www.assembli.design/category/code.md)
- Type: component
- Tags: docs, feedback, helpful, thumbs, pagination, prev-next, edit-page, footer
- npm dependencies: motion, lucide-react
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/doc-feedback
- Page: https://www.assembli.design/components/doc-feedback

![Doc Feedback preview](https://www.assembli.design/thumbnails/doc-feedback-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"footer" \| "inline"` | `"footer"` | `footer` is the end-of-page block; `inline` is a compact one-liner for the end of a section. |
| `question` | `string` |  |  |
| `reasons` | `string[]` | `DEFAULT_REASONS` | Reason chips offered after "No". |
| `defaultHelpful` | `boolean` |  | Start with an answer chosen: `false` opens the reasons form, `true` shows the thank-you. |
| `onSubmit` | `(value: DocFeedbackValue) => Promise<void> \| void` |  | Called with the answer. Reject (throw) to show a retry message. |
| `editHref` | `string` |  |  |
| `editLabel` | `string` | `"Edit this page"` |  |
| `lastUpdated` | `string` |  | ISO date, shown as "Last updated Oct 21, 2026". |
| `previous` | `DocFeedbackLink` |  |  |
| `next` | `DocFeedbackLink` |  |  |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/doc-feedback/doc-feedback.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/doc-feedback
```

Registry item JSON: https://www.assembli.design/r/doc-feedback.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
