Loading
Loading
Loading
mobile footer

Build the Interaction Layer Your Website is Missing.

Browse All EffectsBrowse All EffectsBrowse All EffectsUpgrade to ProUpgrade to ProUpgrade to Pro

70+ effects free, forever. No credit card.

© 2026 Hyperiux. All Rights Reserved.

AI Component CatalogueHey AI, Learn About Us
Platform

Vault

  • Documentation
  • Pricing
  • Blog
  • Community
  • NPM
  • MCP

Categories

  • All Effects
  • WebGL
  • Text
  • Backgrounds
  • Buttons
  • Carousels
  • Scroll
  • Components
  • Navigation
  • Cursor
  • Transitions
  • Loaders

Documents

  • Introduction
  • Installation
  • CLI
  • Dependencies
  • License

Legal

  • License Agreement
  • Terms of Service
  • Privacy Policy
  • Refund Policy
Socials
  • Twitter / X
  • LinkedIn
  • GitHub
  • Instagram
Contact Us
  • hello@hyperiux.com
New effects, in your inbox

Every new drop, plus the occasional behind-the-scenes build. No spam. Unsubscribe anytime.

All Effects
Featured ComponentsText AnimationsAnimated BackgroundsAnimated ButtonsCarousel EffectsScroll EffectsCreative ComponentsNavigationsCursor EffectsTransitionsLoadersWebGL & 3D Effects
Templates
IntroductionInstallationCLIDependenciesLicense
PricingBlogGithubNPMMCP Doc
Loading
Home/effects/Directional Menu

Directional Menu

A direction-aware mega menu where hovering across the top-level items slides each panel in from the side you moved towards, with a separate tap-friendly, keyboard-accessible menu on smaller screens.

GSAPLucide-react
DemoDemoDemo

Tune the Real Props

Active Color

Color for active menu state.

Inactive Color

Color for inactive menu state.

Menu Bg Color

Background color of the menu dropdown panels.

Overview

Directional Menu gives navigation spatial presence: on desktop, hovering a top-level item opens a white mega-menu panel below the header, and moving to an item to its left or right slides the new content in from that side while the panel eases to the new height.

Use it when the site has enough structure to justify a designed menu moment: services, products, resources, docs, use cases, or portfolios. For three links, keep it boring and fast.

The main risk is cleverness in the one place every visitor needs reliability. The desktop menu opens on hover only: its top-level items are buttons with no click, focus, Escape or aria-expanded handling, and an item with a link but no panel (like About) doesn’t navigate. Below 1024px a separate mobile menu takes over with a toggle button, expandable sections, Escape to close, focus trapping and focus restore. Add keyboard and click support to the desktop menu before relying on it as main navigation.


Usage Code

page
1import DirectionalMenu from "@/components/effects/directional-menu";2 3const page = () => {4  return (5    <DirectionalMenu6      activeColor="#ffffff"7      inactiveColor="#ffffff"8      panelGap={20}9      closeDelay={80}10      duration={0.35}11      menuBgColor="#ffffff"12    />13  );14};15 16export default page;

Example Production Use Case

A SaaS platform with separate products, solutions, and developer resources can use Directional Menu as its main header navigation. When a visitor moves from one top-level item to the next, the panel content slides in from that side, so moving between Products and Solutions reads as travel across one connected menu.

The outcome is orientation. Audience groups such as startups, enterprise, and agencies sit in clearly grouped panels, and on smaller screens the same items collapse into a mobile menu with expandable sections.


Best Used For

  • Multi-section marketing sites with services, products, resources, docs, or use cases.
  • Navigation systems where direction-aware panels enhance grouping, once click and keyboard paths are added to the desktop menu.
  • Sites that want designed wayfinding on desktop and a straightforward accordion menu on tablet and mobile.

Not For

Not for tiny sites, hover-only menus, checkout, forms, or navigation where speed and reliability are the whole job.


Performance Budget

Keep panel animations short, avoid layout shift, and do not block route transitions or scroll restoration.


Accessibility and Mobile

The mobile menu (below 1024px) already uses a toggle button with aria-expanded and an open or close label, accordion sections with aria-expanded, real links, Escape to close, focus trapping and focus restore, and it doesn’t depend on hover. The desktop mega menu opens only on mouse hover, so add click, focus, aria-expanded and Escape handling there yourself. With reduced motion, panels switch instantly instead of sliding, and only opening and closing the menu fade.


Common Mistakes

  • Relying on hover only for Directional Menu.
  • Forgetting Escape close and focus restore.
  • Making a simple three-link site feel overbuilt.

Changelog

Added prefers-reduced-motion support: mega menu open/close panel animations use a reduced-motion-safe fade instead of the full height/slide tween
Initial release

API Reference

PropTypeDefaultDescription
closeDelaynumber80Delay before closing the menu.
panelGapnumber20Gap between trigger and submenu panel.
activeColorstring#ffffffColor for active menu state.
inactiveColorstring#ffffffColor for inactive menu state.
durationnumber0.35Menu transition duration.
menuBgColorstring#ffffffBackground color of the menu dropdown panels.

Questions, Answered.

When should I use Directional Menu?

Use it when a multi-section marketing site wants mega-menu panels that slide in from the side the visitor moves towards on desktop, and you are prepared to add keyboard and click support to the desktop menu.

Can Directional Menu work without hover?

Partly. Below 1024px the mobile menu works by tap and keyboard with no hover needed. The desktop mega menu opens only on mouse hover, so keyboard and touch users on wide screens can’t open its panels until you add click and focus handling.

How should Escape and focus restore work for Directional Menu?

In the mobile menu, Escape closes it, focus is trapped across the toggle and panel while open, and focus returns to the toggle on close. The desktop mega menu has no Escape handling or focus management; it closes when the pointer leaves, after a short close delay.

How should Directional Menu behave on mobile?

Below 1024px the desktop menu is hidden and a mobile menu appears: a toggle button opens a dropdown panel where items with panels become expandable accordion sections and plain items are links that close the menu when tapped.

What happens with reduced motion?

When prefers-reduced-motion is on, the desktop panel opens and closes with a short fade of about 0.16 seconds and switches content without sliding sideways, and the mobile menu’s transitions and chevron rotation are turned off.

Can Hyperiux adapt Directional Menu for a real brand system?

Yes. A custom version can define motion rules, visual treatment, desktop keyboard and click support, performance budget, fallback behaviour, source handoff, and implementation notes for the specific page or launch context.

Request a Custom Animation

Need a custom effect? Tell us what to create.

Related Effects

Explore All EffectsExplore All EffectsExplore All Effects
Immersive Full-Screen Navigation
GSAP

Immersive Full-Screen Navigation

Navigation

Expanding Navbar
Pro
GSAPLucide-react

Expanding Navbar

Navigation

Elevate Navbar
GSAPLucide-react

Elevate Navbar

Navigation