EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
TopNav·component·@astryxdesign/core

Top Nav Mega Menu

Navigation item that displays a full-width mega menu panel on hover. Uses a slots API with items and featured props. TopNavMegaMenuItem renders itself in both desktop and mobile drawer modes. Supports inline collapsible drawer via render mode context.

Open in Playground @astryxdesign/core/TopNav

Showcases and examples

2 documented examples

Top Nav Mega Menu

Demonstrates TopNavMegaMenu with items and a featured card in the mega menu panel.

Preview loads on approachPreview loads on approach
Exact source · top-nav-mega-menu-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {
  TopNav,
  TopNavHeading,
  TopNavItem,
  TopNavMegaMenu,
  TopNavMegaMenuItem,
  TopNavMegaMenuFeaturedCard,
} from '@astryxdesign/core/TopNav';
import {
  RocketLaunchIcon,
  BookOpenIcon,
  CodeBracketIcon,
  ShieldCheckIcon,
  MagnifyingGlassIcon,
} from '@heroicons/react/24/outline';

export default function TopNavMegaMenuShowcase() {
  return (
    <TopNav
      style={{width: 600}}
      label="Mega menu demo"
      heading={<TopNavHeading heading="DevTools" />}
      startContent={
        <>
          <TopNavItem label="Overview" href="#" isSelected />
          <TopNavMegaMenu
            label="Products"
            items={
              <>
                <TopNavMegaMenuItem
                  title="Deploy"
                  description="Ship to production in seconds"
                  icon={<RocketLaunchIcon width={20} height={20} />}
                  href="#deploy"
                />
                <TopNavMegaMenuItem
                  title="Documentation"
                  description="Guides, references, and tutorials"
                  icon={<BookOpenIcon width={20} height={20} />}
                  href="#docs"
                />
                <TopNavMegaMenuItem
                  title="API"
                  description="Programmatic access to all features"
                  icon={<CodeBracketIcon width={20} height={20} />}
                  href="#api"
                />
                <TopNavMegaMenuItem
                  title="Security"
                  description="Enterprise-grade protection"
                  icon={<ShieldCheckIcon width={20} height={20} />}
                  href="#security"
                />
              </>
            }
            featured={
              <TopNavMegaMenuFeaturedCard
                title="What's New"
                description="Check out our latest features and improvements in the Q2 release."
                linkLabel="Read the changelog"
                linkHref="#changelog"
              />
            }
          />
        </>
      }
      endContent={<MagnifyingGlassIcon width={20} height={20} />}
    />
  );
}

Usage

Navigation item that displays a full-width mega menu panel on hover. Uses a slots API with items and featured props. TopNavMegaMenuItem renders itself in both desktop and mobile drawer modes. Supports inline collapsible drawer via render mode context.

Typed props

PropType and behavior
labelstring · required
Visible label for the trigger button.
itemsReactNode
Menu items slot: typically TopNavMegaMenuItem components, but accepts any ReactNode.
featuredReactNode
Featured content slot: rendered in the right panel on desktop, below items in the mobile drawer.
Slot: Card
delaynumber · default 150
Delay in milliseconds before showing the menu on hover.
hideDelaynumber · default 250
Delay in milliseconds before hiding the menu after the mouse leaves.
onOpenChange(isOpen: boolean) => void
Callback fired when the mega menu opens or closes. Useful for coordinating wrapper styles.