Ajouter

Lorem ipsum

Lorem ipsum

Design

5 min

How to Create an Animated Burger Menu in Webflow

Learn how to create an animated burger menu in Webflow — turning the hamburger into a close icon — without plugins, using CSS transitions and JavaScript.

In this tutorial, Sandro, cofounder of Gemeos Webflow agency, shows you how to create an animated burger menu (hamburger → cross) in Webflow without a plugin.

Example

LineCSS classClick transformation
Line 1burger-line-145° rotation and translation
Line 2burger-line-2Opacity 0 (disappears)
Line 3burger-line-3-45° rotation and translation

1. Create the burger button

Create a Div burger-btn containing 3 Divs: burger-line-1, burger-line-2, burger-line-3. Each line: width 24px, height 2px, background in your color, margin-bottom 5px. Add cursor: pointer to the container.

2. Add the transition CSS

.burger-line-1, .burger-line-2, .burger-line-3 {
transition: all 0.3s ease;
}
.burger-btn.open .burger-line-1 {
transform: rotate(45deg) translate(5px, 5px);
}
.burger-btn.open .burger-line-2 {
opacity: 0;
}
.burger-btn.open .burger-line-3 {
transform: rotate(-45deg) translate(5px, -5px);
}

3. Add the toggle script

const burger = document.querySelector('.burger-btn');
const nav = document.querySelector('.mobile-nav');
burger.addEventListener('click', function() {
burger.classList.toggle('open');
nav.style.display = nav.style.display === 'flex' ? 'none' : 'flex';
});

good to know

If you use Webflow’s native Navbar, it already generates a burger button with its own logic. This tutorial is useful if you’re building a custom navigation without using the native Navbar component. For the native navbar, customize the animation through Webflow interactions on the existing menu-button.

Conclusion

An animated burger menu improves the mobile experience. Use cases:

  • Custom mobile navigation
  • Sidebar or drawer menu
  • Full-screen overlay menus

Published on

You might be interested in these tutorials

Similar tutorials

SEO / GEO

5 min read

5 views

How to Set Up a Redirect in Webflow? (2026)

Updated on 19.12.2025 by Sandro DA SILVA

SEO / GEO

5 min read

5 views

Add structured data to your Webflow site?

Updated on 21.08.2025 by Sandro DA SILVA

No-code

5 min read

5 views

How to Obfuscate a Link in Webflow

Updated on 23.04.2025 by Sandro DA SILVA

Let’s f*****G GO !!

Ready to launch
Your business?

Alexandre

Max

Enora

Bryan

Cannelle

Tiphaine

You'll :heart: our collaboration...