Toggle

A simple toggle script for menus, accordions, navigation, and more.

What is Toggle?

Toggle is a lightweight JavaScript module that provides simple toggle interaction functionality using the accessible aria-expanded HTML attribute. Toggle is pure JavaScript with no dependencies, and can be easily implemented into any workflow or framework.

Getting Started

See the GitHub repo for installation and configuration instructions.


Toggle Recipes

Toggle is deceptively simple. With a bit of configuration and a dash of CSS, it can be used for context menus, accordions, tabs, modals, mobile navigation menus, and more. Some of the most common Toggle patterns, or recipes, are shown below. Note that some recipes use the Font Awesome icon font. We'll start out basic and move into more complex patterns as we go.