Gooey Button
A liquid gooey button: droplets at the bottom fuse through an SVG goo filter, well up to cover the button on hover, and splash out thick droplets at the click point.
npx shadcn@latest add https://webberui.com/r/gooey-button.jsonPlayground
Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.
<GooeyButton />
Installation
npx shadcn@latest add https://webberui.com/r/gooey-button.jsonOr, once registries are configured in components.json, install it as @webberui/gooey-button.
Usage
import { GooeyButton } from "@/components/ui/gooey-button";
<GooeyButton onClick={() => save()}>Hover to see the liquid</GooeyButton>
<GooeyButton variant="danger">Delete project</GooeyButton>Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'danger' | 'default' | Visual variant: default is neutral, danger is the red scheme (for dangerous actions) |
className | string | — | Overrides the default styles |
children | ReactNode | — | Button content |
All other <button> attributes (onClick, disabled, aria-*, and so on) are forwarded directly.
How it works
- The goo filter: the liquid layer gets an SVG
feGaussianBlur+feColorMatrixfilter — blur first, then push up the alpha contrast, which fuses neighbouring circular droplets into one organic gooey shape. The filter id is generated withuseId, so multiple buttons on the same page never contaminate each other - Rest and welling up: at rest the droplets sink to the bottom of the button, showing only a sliver of an arc; on hover or keyboard focus-visible the liquid "wakes up" and wells up to cover the whole button, each droplet rising and falling on its own period to form a staggered surface
- Click splash: a cluster of droplets bursts out at the pressed coordinates, spreading and fading quickly, connected to the liquid surface through the same goo filter; when triggered from the keyboard (Enter / space bar) the splash comes from the button's center
- Press feedback: the whole button scales slightly on
whileTap
Accessibility
- The liquid layer and the filter are both marked
aria-hidden— decorative only, so they do not interfere with assistive technology; the text content sits on its own layer above, unaffected by the filter blur and staying crisply readable - Full keyboard support:
focus-visiblewakes the liquid the same way, and Enter / space bar trigger a centered splash - When the user has "reduce motion" enabled at the system level: the droplets' looping motion and the click splash are removed, and hovering only lifts the liquid surface statically with a single transition, with no back-and-forth animation
- The trigger is a
<button>itself, sodisabled, thefocus-visibleoutline, keyboard operation, and other native semantics are all preserved
Hold to Confirm
A press-and-hold fill confirmation button: holding fills the progress from left to right with a slight tremor near completion, and only a full fill triggers it — preventing accidental taps on dangerous actions.
Draggable Snap Button
A button you can drag that springs back and snaps: wherever you drag it, on release a spring snaps it to the nearest snap point — with multiple snap points, arrow-key switching, and a pure spring-back mode.