Menu Wrapper API
Dispatched Events
Event Name
Detail
Description
Examples
Detecting Mobile/Desktop Transitions
const menuWrapper = document.querySelector('[data-menu-element="menu-wrapper"]');
// Listen for mobile view entry
menuWrapper.addEventListener("menuWrapper:mobile", () => {
console.log("Switched to mobile view");
// Example: Initialize mobile-specific features
initMobileGestures();
});
// Listen for desktop view entry
menuWrapper.addEventListener("menuWrapper:desktop", () => {
console.log("Switched to desktop view");
// Example: Clean up mobile features
destroyMobileGestures();
});Checking Current Viewport State
Integration with Toggle Component
Responsive Behavior Coordination
Last updated