Gooey Search Bar

A gooey expanding search bar: focusing the input melts a round action button out of the pill with an SVG goo filter. Controlled or uncontrolled, keyboard-friendly, with full color and sizing control.

Gooey Components

Focus melts the button out

Click the input — the goo filter fuses the round action into the bar.

Installation

  1. 1

    Install the component:

    npx shadcn@latest add https://ui.amines.fun/registry/gooey-search-bar.json
  2. 2

    Usage:

    jsx

    app/page.jsx

    <GooeySearchBar  placeholder="Search components..."  onSearch={(query) => console.log(query)}/>

Props

PropTypeDefaultDescriptionRequired
placeholderstring"Search..."Input placeholder.No
valuestringundefinedControlled input value.No
defaultValuestring""Initial value when uncontrolled.No
onChange(value, event) => voidundefinedCalled on every keystroke.No
onSearch(value, event) => voidundefinedCalled on submit (Enter or button click).No
namestringundefinedname attribute for the input.No
ariaLabelstring"Search"Accessible label.No
buttonLabelstring"Search"Label for the round action button.No
disabledbooleanfalseDisables the whole search bar.No
autoFocusbooleanfalseFocus the input on mount.No
iconReactNodeFiSearchLeading icon inside the input.No
openbooleanundefinedControlled open state of the goo button.No
onOpenChange(open: boolean) => voidundefinedCalled when the goo button opens/closes.No
keepOpenWhenFilledbooleantrueKeep the button open while the input has a value.No
closeOnEscapebooleantrueBlur the input on Escape.No
widthnumber | string320Bar width (px or CSS).No
heightnumber | string48Bar height (px or CSS).No
radiusnumber | "full" | string"full"Corner radius of the bar.No
paddingstring"0 20px"CSS padding of the bar.No
buttonSizenumber | "auto" | string"auto"Round button size; auto derives from height.No
buttonRadiusnumber | "full" | string"full"Corner radius of the button.No
iconSizenumber20Icon size in px.No
buttonIconReactNodeFiSearchIcon inside the round button.No
side"left" | "right""right"Which side the button morphs from.No
gapnumber12Space between bar and button while open, px.No
borderWidthnumber1Outline width in px (0 = none).No
shadowstring | false"0 12px 28px rgba(0,0,0,0.35)"CSS box-shadow, or false for none.No
reserveSpacebooleanfalseReserve layout space for the open button.No
blurnumber8Goo amount. 0 turns the goo effect off.No
spring{stiffness?, damping?, mass?}GOOEY_SEARCH_DEFAULT_SPRINGOverride the morph spring.No
colorsPartial<GooeySearchColors>GOOEY_SEARCH_DEFAULT_COLORSTheme: fill, border, text, mutedText, buttonIcon, hover, focus.No
zIndexnumber50z-index of the search bar.No
className / inputClassName / buttonClassNamestring""Extra classes for the bar, input, and button.No