Gooey Search Input, animated React component
A search pill whose icon pinches off into its own bubble through an SVG goo filter when you open it, while the field grows with a springy overshoot. Pass suggestions and the matches drip out of the underside of the field through the same goo, with arrow-key navigation.
- Free
- Motion Effects
- Spring
Pops open, switches off on close and taps when you pick a suggestion. 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 Gooey Search Input? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Gooey Search Input stays free.
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| placeholder | string | "Type to search..." | Placeholder of the open field. |
| collapsedLabel | string | "Search" | Label on the collapsed pill. |
| collapsedWidth | number | 115 | Width of the pill while collapsed, in px. |
| expandedWidth | number | 200 | Width of the open field, in px. |
| expandedOffset | number | 56 | Room left of the open field for the icon bubble, in px. |
| gooeyBlur | number | 5 | Blur of the goo filter; higher melts the shapes together more. |
| suggestions | string[] | — | Words to suggest; up to four matches drip out below while typing. |
| onSelect | (value: string) => void | — | Called when a suggestion is picked with a click or Enter. |
| value | string | — | Controlled value. |
| defaultValue | string | "" | Initial value when uncontrolled. |
| onValueChange | (value: string) => void | — | Called when the text changes (and with "" when the field closes). |
| onOpenChange | (open: boolean) => void | — | Called when the field opens or closes. |
| autoplay | boolean | false | Opens, types a query and closes on a loop until someone touches it. |
| disabled | boolean | false | Dims the pill and ignores input. |
| 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/gooey-input
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/gooey-input.tsxgooey-input/gooey-input.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 { GooeyInput } from "@/components/gooey-input"; export default function Page() { return ( <main> <GooeyInput /> </main> ); }
Like Gooey Search Input? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Gooey Search Input stays free.
About Gooey Search Input
The Gooey Search Input expands into a suggestion panel with a gooey morphing animation powered by SVG feMerge filter compositing. The input field and suggestion list share the gooey filter group, causing their edges to merge organically when the suggestion panel appears. Spring physics govern the expand and collapse transitions. A memorable interaction pattern that signals creative, high-craft product development for developer tools and creative platforms.
Good for
- Site-wide and product search bars
- AI and command search inputs
- Creative tool search interfaces
- Developer tool query inputs
Gooey Search Input questions
How do I install the gooey search input?
Run `npx shadcn@latest add @nexus-labs/gooey-input`. Note that the registry name is `gooey-input`, not the page slug. It installs framer-motion and lucide-react.
Can I use it as a controlled input?
Yes. Pass `value` with `onValueChange`, or use `defaultValue` for uncontrolled mode. `onOpenChange` tells you when it expands or collapses.
When does it collapse again?
It collapses on blur when the field is empty, and Esc blurs it. The text is cleared when it collapses.
How do I change its size and the goo strength?
`collapsedWidth` (115), `expandedWidth` (200) and `expandedOffset` (56) are in pixels, and `gooeyBlur` (5) sets the SVG blur that merges the shapes. It shows a dark pill in light mode and a white pill in dark mode.
Does it make sound, and how do I turn it off?
Pops open, switches off on close and taps when you pick a suggestion. 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.