339

Hamburger Icon Morphs

Four ways the three lines can morph: spin into an X, fold into a back arrow, slide out for an X, or collapse into one line; click to toggle

ButtonSwitchHover & clickUI interactionApp UICSSHamburger · Icon

Hannah's Motion Library
Web motion effects × AI prompts

AI prompt

A row of four round hamburger menu buttons, each with a small caption below; click to toggle open (the button fill switches to the accent color and the lines turn dark), click again to go back to three lines. Four morphs: ① Spin to X: the whole icon turns half a circle with overshoot while the top and bottom lines meet in the middle as an × and the middle line shrinks away; ② Back arrow: the top and bottom lines pivot on their left ends, fold toward the middle and shrink to half length, forming a ← with the middle line, while the whole icon spins once; ③ Slide swap: the three lines slide out to the right one after another, then two diagonal lines slide in from the left in turn to form an ×, reversing on close; ④ Collapse: the top and bottom lines spring into the middle and the three merge into one slightly shorter line. Hovering a closed button shortens the middle line. When idle, each button demonstrates in turn. (CSS: each line is position:absolute and morphs with translateY + rotate; transitions use cubic-bezier(.68,−.55,.27,1.55) for overshoot; ③ uses overflow:hidden and a different transition-delay per line)

When you copy it, a note to “match the site’s existing theme colors” is added automatically, so you don’t need to specify colors.

How to use it

  1. Tap “Copy AI prompt”.
  2. Paste it into an AI such as ChatGPT or Claude, and tell it which element on your site to apply it to (for example, the homepage headline or a buy button).
  3. The AI writes code that matches your site’s colors. Paste it into your project, then fine-tune the timing and distances.

More button effects

346 more motion effectsText, buttons, cards, backgrounds, cursors… preview them all and copy AI prompts

Browse all effects →