Mobile Nav Button Markdown

Mobile Nav Button

Source: https://dripyard.com/docs/greatlakes/components/gl-mobile-nav-button

Theme: greatlakes

A hamburger menu button component that toggles mobile navigation visibility. Features animated transformation between hamburger and close (X) icons.

Usage

{{ include('greatlakes:mobile-nav-button', with_context = false) }}

This component requires no props and is typically included directly in the header template.

CSS Custom Properties

  • --mobile-nav-button-line-color - Color for hamburger menu lines

Responsive Behavior

The button adapts to screen width at 1000px breakpoint:

  • Mobile (≤1000px): Visible and functional
  • Desktop (>1000px): Hidden via display: none

Animation States

The component transforms between two visual states:

  • Collapsed: Three horizontal lines (hamburger icon)
  • Expanded: Two diagonal lines forming an X (close icon)
  • Smooth transitions: 0.2s animation between states

Accessibility Features

  • Screen reader text: "Menu" label for assistive technology
  • ARIA states: Works with aria-expanded attribute set by JavaScript
  • Keyboard support: Standard button focus and activation
  • High z-index: Ensures button stays above expanded mobile menu

Integration

  • Data selector: Uses data-drupal-selector="mobile-nav-button" for JavaScript targeting
  • State management: Visual state controlled by aria-expanded attribute on button
  • Header coordination: Designed to work within the header component system

Column Layout Helper

This is the column layout helper, which you can use to configure

  • Vertical and horizontal spacing
  • Vertical and horizontal alignment
  • Spacing between components
  • Enable stickyness

This helper will not be visible unless editing this page.

Current values:

Padding top Not set
Padding bottom Not set
Horizontal alignment Not set
Vertical alignment Not set
Gutter medium
Stickyness Enabled
Hide mobile Not set
Hide desktop Not set