CSS Gooey Menu Animation

Round actions that stretch out of a blob. An SVG goo filter welds the circles while they move.


CSS Gooey Menu Animation


A gooey menu is a cluster of round buttons that stretch apart as if they were one liquid. The stretch is not a border-radius trick. An SVG filter blurs the circles, then a color matrix pushes the blurred alpha so the soft edges weld together. The original sharp circles are painted back on top, which keeps the labels readable while the bridge between them stays soft.

Use it for three or four actions that belong to one object: draw, type, send. It is a bad primary navigation. People do not hunt through a blob for “Pricing”. For a full set of links, use the glassmorphic navigation or the floating action arc menu. The circular hamburger is the older cousin of this bloom.

The filter

<svg aria-hidden="true" width="0" height="0">
  <filter id="goo">
    <feGaussianBlur in="SourceGraphic" stdDeviation="16" result="blur"></feGaussianBlur>
    <feColorMatrix in="blur" mode="matrix"
      values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 18 -7" result="goo"></feColorMatrix>
    <feComposite in="SourceGraphic" in2="goo" operator="atop"></feComposite>
  </filter>
</svg>

stdDeviation is how far the liquid reaches. The last row of the matrix, 20 -8, is the contrast of the alpha: values above a threshold become solid, which is why the blur collapses into a blob instead of a fog. If the bridges disappear, raise the blur or lower the subtract term (-8 toward -6). If the whole menu turns into one puddle, do the opposite.

Apply it with filter: url(#goo) on the element that contains every circle.

The motion

Closed, every circle shares one coordinate. Open, each one translates to its own offset. The filter runs during the transform, so the bridge appears on the way out and pinches off at the end.

.menu { filter: url("#goo"); position: relative; }
.menu button {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fb923c;
  transition: transform .55s cubic-bezier(.2,.8,.2,1);
}
.menu.is-open button:nth-child(1) { transform: translate(-58px, -34px); }
.menu.is-open button:nth-child(2) { transform: translate(0, -68px); }
.menu.is-open button:nth-child(3) { transform: translate(58px, -34px); }

Keep the travel short. A circle that flies across the screen spends most of the animation too far from the parent for the goo to connect, and then it just looks like a normal fan menu. The point of this effect is the frame where they are almost apart.

Opening it

The main circle is a button with aria-expanded. The demo opens once on load so the weld is visible, then the same button toggles it. Escape-to-close is worth adding when this menu covers content. The three actions should be real buttons with names, not icons alone.

Reduced motion can leave the menu open in its final positions with the transition duration near zero. The filter can stay. It is a paint effect, not a vestibular one, once the circles have stopped moving.

Questions about gooey menus

How does a CSS gooey effect work?

Blur the graphic, then run a color matrix that forces semi-transparent pixels either to solid or to empty. Neighboring blurs cross the threshold together, so two circles look fused. Composite the sharp original on top if you need readable labels.

Why is my gooey menu a gray box?

The filter id does not match, or the SVG is display: none. Hidden SVG filters are dropped in some browsers. Keep the SVG in the document with width: 0; height: 0 and aria-hidden="true", and reference it as url(#goo).

How many items can a gooey menu hold?

Three or four. A fifth circle either overlaps the weld or flies outside the blur radius. If you need more actions, switch to the arc menu and keep the gooey treatment for a smaller tool.