Response FeedbackPRO
Reason chips and a comment after a thumbs-down, collapsing into a thank-you.
Code
1 file · 298 lines of TypeScriptPRO
Response Feedback is part of Pro
Get its source, the one-paste agent prompt and all 113 components, for a one-time $99.
Motion notes
- The panel grows open on the layout spring and its chips rise in on a short stagger, so it feels attached to the thumbs-down that opened it.
- A selected chip grows its own width to make room for the check, so neighbours glide aside instead of jumping. The check draws on the elastic spring: a small reward, scaled by the personality.
- On submit the form blurs out and the wrapper springs from its measured height down to a single “Thanks for the feedback” line. Focus moves to that line so keyboard users aren't stranded.
- With reduced motion the panel fades instead of growing, heights change instantly and the check appears without drawing.
Usage
Example
const [vote, setVote] = useState<"up" | "down" | null>(null);
<MessageActions onFeedback={setVote} />
<FeedbackForm
open={vote === "down"}
onSubmit={(value) => sendFeedback(messageId, value)}
onClose={() => setVote(null)}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | true | Expands the panel, e.g. right after a thumbs-down. |
| reasons | string[] | ["Inaccurate", "Too long", …] | Reason chips. Multi-select. |
| title | string | "What went wrong?" | Heading, also labels the chip group. |
| placeholder | string | "Anything else? (optional)" | Comment placeholder. |
| value | { reasons: string[]; comment: string } | — | Controlled selection and comment. |
| onValueChange | (value: FeedbackValue) => void | — | Called when a chip or the comment changes. |
| submitted | boolean | — | Controlled submitted state. |
| onSubmit | (value: FeedbackValue) => void | — | Called on Submit or ⌘/Ctrl+Enter. Needs a reason or a comment. |
| onClose | () => void | — | Shows close and Cancel buttons, and handles Escape. |
| className | string | — | Classes for the wrapper. |