A Feedback button that opens in place into a small form, a mood row, a note and Send, and closes back into itself. The send is async: it shows sending, keeps the note and offers Retry when it fails, and folds back into the button with a drawn check when it lands.
On this page
- Feedback on an AI answer
- A beta feature's corner of the screen
- Docs page "Was this helpful?"
- In-app bug reports
Examples
A short note only
Installation
Installation is part of Pro
Pro components install from a licensed registry. The live preview stays open to everyone.
Props
- onSubmit
(value, signal) => Promise<void>- Sends { mood, message }. Resolve when stored, throw when it failed. The signal aborts when the form closes mid-send or unmounts.
- label
string- Default
"Feedback" - The button's label.
- icon
ReactNode- Default
speech bubble - The button's icon.
- title
string- Default
label - The form's heading, also its accessible name.
- placeholder
string- Default
"What would make this better?" - The note's placeholder.
- moods
FeedbackMood[]|false- Default
four faces - The mood row: { value, label, icon }. false hides it. Picking the selected mood again clears it.
- attachment
ReactNode- Your own attach or screenshot button, between the moods and Send. You keep its state.
- sentLabel
string- Default
"Thanks" - Shown with the check in the button after a send.
- sentFor
number- Default
1600 - How long the check stays, in ms, before the label returns and the draft clears.
- failedText
string- Default
"Couldn't send. Your note is kept, try again." - The line under the note when onSubmit threw.
- open
boolean- Controlled open state.
- defaultOpen
boolean- Default
false - Open on first render, with no entrance.
- onOpenChange
(open) => void- Called on open, close, Escape, a click outside and after a send.
- side
"top"|"bottom"- Default
"bottom" - Which way the form grows from the button.
- align
"start"|"end"- Default
"start" - The button edge the form keeps: start grows right, end grows left.
- width
number- Default
320 - The open form's width, clamped to the room beside the button less 16px.
- className
string- On the wrapper, which keeps the button's size in the layout.
| Prop | Type | Default | Description |
|---|---|---|---|
| onSubmit | (value, signal) => Promise<void> | - | Sends { mood, message }. Resolve when stored, throw when it failed. The signal aborts when the form closes mid-send or unmounts. |
| label | string | "Feedback" | The button's label. |
| icon | ReactNode | speech bubble | The button's icon. |
| title | string | label | The form's heading, also its accessible name. |
| placeholder | string | "What would make this better?" | The note's placeholder. |
| moods | FeedbackMood[] | false | four faces | The mood row: { value, label, icon }. false hides it. Picking the selected mood again clears it. |
| attachment | ReactNode | - | Your own attach or screenshot button, between the moods and Send. You keep its state. |
| sentLabel | string | "Thanks" | Shown with the check in the button after a send. |
| sentFor | number | 1600 | How long the check stays, in ms, before the label returns and the draft clears. |
| failedText | string | "Couldn't send. Your note is kept, try again." | The line under the note when onSubmit threw. |
| open | boolean | - | Controlled open state. |
| defaultOpen | boolean | false | Open on first render, with no entrance. |
| onOpenChange | (open) => void | - | Called on open, close, Escape, a click outside and after a send. |
| side | "top" | "bottom" | "bottom" | Which way the form grows from the button. |
| align | "start" | "end" | "start" | The button edge the form keeps: start grows right, end grows left. |
| width | number | 320 | The open form's width, clamped to the room beside the button less 16px. |
| className | string | - | On the wrapper, which keeps the button's size in the layout. |
Accessibility
- The button has aria-expanded and controls the form, which is named by title.
- Opening moves focus into the note. Escape, the close button, a click outside and a finished send put focus back on the button (a click outside leaves it where you clicked when that took focus).
- The mood row is a radio group with a label on every face. Cmd or Ctrl and Enter sends from the note.
- Sending, sent and failed are read once from a polite status region; the failed line is also an alert.
- While the form closes it is inert, so nothing in it can be reached. With reduced motion it opens and closes at once.
What it handles
- 01Opens the Feedback button in place into a small form: a mood row, a note, a slot for your attach button and Send. No modal, nothing behind it dims.
- 02Grows from the corner it shares with the button and shrinks back into it, so the form reads as the button opened up.
- 03Sends through your async onSubmit with an AbortSignal. Closing mid-send aborts it and keeps the note.
- 04Shows sending on the Send button, keeps the text and turns Send into Retry when the call throws, and folds back into the button with a drawn check when it lands.
- 05Keeps the draft on Escape and on a click outside. Focus moves into the note on open and back to the button on close.
- 06Sends with Cmd or Ctrl and Enter from the note.
States
- First render
- Nothing. Closed, or open when defaultOpen
- none
- Open
- The button's label fades out, the box grows to the form, the form fades in
- 280ms ease in and out; 120ms out, then 180ms in
- Note grows or the failed line shows
- The box follows the form's height
- 180ms, ease in and out
- Sending
- Send shows a spinner; the note is read only
- none
- Failed
- The line under the note fades in; Send reads Retry
- 180ms, ease out
- Close or sent
- The form fades out, the box shrinks into the button, the label fades back
- 120ms, then 280ms ease in and out
- Sent
- The check draws in the button once it lands, then the label returns
- 180ms draw; label back after 1.6s
- Reduced motion
- Every change lands at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. Closed, or open when defaultOpen | none |
| Open | The button's label fades out, the box grows to the form, the form fades in | 280ms ease in and out; 120ms out, then 180ms in |
| Note grows or the failed line shows | The box follows the form's height | 180ms, ease in and out |
| Sending | Send shows a spinner; the note is read only | none |
| Failed | The line under the note fades in; Send reads Retry | 180ms, ease out |
| Close or sent | The form fades out, the box shrinks into the button, the label fades back | 120ms, then 280ms ease in and out |
| Sent | The check draws in the button once it lands, then the label returns | 180ms draw; label back after 1.6s |
| Reduced motion | Every change lands at once | 0ms |
Works with
When to use
When to use
- A note on one AI answer or one screen, written where it happened: a mood, a sentence and Send, without a dialog over the work.
- A beta feature asking for feedback from a small button in its corner, then thanking the person in the same button.
When not to use
- One-click thumbs under each message: use Message Actions.
- A long survey or a form with many fields: use Dialog.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Feedback Morph to my app and wire it to my own data.
- I need a note on one AI answer or one screen, written where it happened: a mood, a sentence and Send, without a dialog over the work. Set that up with the Knowns UI Feedback Morph.
- Which Feedback Morph props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "feedback-morph" }) and search_docs({ query: "feedback morph" }). Pro props, full examples and source come back once your license key is in the MCP config.