explaingit

jonsuh/hamburgers

7,099SCSSAudience · designerComplexity · 1/5Setup · easy

TLDR

A CSS library with 30+ animated styles for the hamburger menu button, drop-in ready with a single HTML snippet and one CSS file, no JavaScript needed, just add a class to trigger the animation.

Mindmap

mindmap
  root((hamburgers))
    What it does
      Animated CSS icons
      30 animation styles
      Menu toggle button
    Tech Stack
      CSS SCSS
      npm yarn
    Customization
      Size and color
      Line thickness
      Hover effects
    Use Cases
      Mobile nav toggle
      Website UI polish
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add an animated spin, elastic, or squeeze hamburger button to your mobile navigation in under five minutes.

USE CASE 2

Pick from 30+ distinct animation styles for the menu toggle without writing any CSS keyframes yourself.

USE CASE 3

Customize icon size, color, line thickness, and spacing through Sass variables to match your site's brand.

USE CASE 4

Include only the animation styles you need via Sass imports to keep your final CSS bundle small.

Tech stack

CSSSCSSnpmyarnBower

Getting it running

Difficulty · easy Time to first run · 5min

Drop in one CSS file and add one HTML snippet, no build step or JavaScript required for basic usage.

In plain English

Hamburgers is a collection of animated icons for the three-line "hamburger" button that appears on mobile sites and apps to open or close a navigation menu. This library gives you more than 30 different animation styles to choose from, so that button can spin, collapse, squeeze, flip in 3D, or do a dozen other things when a user taps it. To use it, you download a single CSS file and drop it into your webpage. Then you add a short block of HTML wherever you want the button to appear, and pick which animation style you want by adding a class name like "hamburger--spin" or "hamburger--elastic" to the element. When the user clicks the button, your JavaScript adds one more class called "is-active" to play the animation. The library handles all the visual work, you only need to wire up the click event. For developers who write Sass (a tool that compiles into regular CSS), the library ships as a Sass module too. You can install it through npm, yarn, Bower, or as a Ruby gem for Rails projects. This lets you pick only the animation styles you actually need, keeping your final CSS file smaller. You can also override settings like the icon size, color, line thickness, spacing between lines, and hover effects, all through Sass variables before the library is imported. The README includes guidance on making the button accessible to people who use screen readers or keyboards. This involves adding ARIA attributes to the HTML so assistive technologies know whether the menu is open or closed, and placing the button inside a navigation element so it is easy to locate. Using a proper button element rather than a generic div is recommended, since buttons are focusable by default. The project is purely visual, a styling utility with no JavaScript of its own and no server-side component. It is a drop-in resource for any website that needs an animated menu toggle button and wants more personality than a static icon.

Copy-paste prompts

Prompt 1
I want a spinning hamburger button for my website's mobile nav. Show me the exact HTML markup and CSS class to use from this library.
Prompt 2
How do I install hamburgers.css via npm and import only the elastic animation style in my Sass build?
Prompt 3
How do I wire up the hamburger button's is-active class toggle in vanilla JavaScript so it plays when the menu opens?
Prompt 4
How do I make the hamburger button accessible with ARIA attributes so screen reader users know whether the menu is open or closed?
Prompt 5
I want to change the hamburger icon color to white and make it larger. Which Sass variables do I override before importing the library?
Open on GitHub → Explain another repo

← jonsuh on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.