Feedback Pill, animated React component
A small Feedback pill that morphs into a note form, shows a spinner in the Send button while it posts, then shrinks into a thank-you before folding back into the pill.
- Free
- Inputs & Controls
- Spring
Pops open, taps shut, chimes when the message is sent and bumps if sending fails. Sound is off on this site until you switch it on.
Types with a key click for every character, in sync with the text. The click stays off until you switch it on.
Like Feedback Pill? 301 more are in Pro.
Pro unlocks all 301 Pro components, every template and block, and everything we release next. Feedback Pill stays free.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| onSend | (message: string) => void | Promise<void> | — | Called with the message. The spinner shows until it resolves. |
| label | string | "Feedback" | Pill label and form title. |
| placeholder | string | "What would make this better?" | Textarea placeholder. |
| accent | string | "#0071e3" | Send button and focus colour. |
| autoplay | boolean | false | Opens, types and sends a sample message until someone interacts. |
| enableSound | boolean | true | Plays interface sounds on interaction. They follow the sound switch (setSoundsEnabled, on by default) and stay silent on hover. Autoplay makes the same sounds once the visitor has used the page. Pass false to silence this component. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry
Run this once per project. It writes the Nexus UI entry into
components.jsonfor you:npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"Type it exactly as shown.
{name}is filled in by the CLI with the component you ask for, so you never replace it.
- 3
Add the component
Run this from your project root. It adds the component, the helpers it imports and its npm packages.
npx shadcn@latest add @nexus-labs/feedback-pill
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/feedback-pill/feedback-pill.tsxindex.ts - 5
Copying by hand? Skip the registry
Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that
cn()exists. Install the packages:npm install framer-motion
Then show the source and create each file at the path it gives:
- 6
Use it in a page
Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:
// src/app/page.tsx import { FeedbackPill } from "@/components/feedback-pill"; export default function Page() { return ( <main> <FeedbackPill /> </main> ); }
Like Feedback Pill? 301 more are in Pro.
Pro unlocks all 301 Pro components, every template and block, and everything we release next. Feedback Pill stays free.
Feedback Pill questions
How do I install the Feedback Pill?
Run `npx shadcn@latest add @nexus-labs/feedback-pill`. It installs framer-motion, and the morph from pill to form is a Framer Motion layout animation.
How do I send the feedback to my own backend?
Pass `onSend`, which receives the message string and can return a promise. The Send button shows a spinner until the promise resolves (for at least 900 ms), then the pill shows "Thanks, got it." and folds back after about 1.7 seconds. The component does not send anything over the network itself.
Where does it go on the page, and how do I change the text and color?
It is not fixed-positioned, so wrap it in your own container such as `fixed bottom-6 right-6`. `label` sets the pill text and form title (default "Feedback"), `placeholder` sets the textarea hint (default "What would make this better?") and `accent` sets the Send button and focus color (default `#0071e3`).
What keyboard shortcuts does it support?
Press Cmd+Enter or Ctrl+Enter in the textarea to send and Escape to close the form. The textarea has a real `label`, Send is disabled while the text is empty, and the confirmation uses `role="status"`. Interface sounds are on by default and can be turned off with `enableSound={false}`.
Does it make sound, and how do I turn it off?
Pops open, taps shut, chimes when the message is sent and bumps if sending fails. Sounds are synthesised with the Web Audio API, so there are no audio files, and they only play after a click or key press. Pass `enableSound={false}` to silence this component, or call `setSoundsEnabled(false)` from `@/lib/ui-sounds` to switch every sound off at once. The CLI installs `@/lib/ui-sounds` with the component.