EXEPERTAI LAB

Research alpha

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

Nav Heading Menu

Accessible menu container and items for nav heading popovers. NavHeadingMenu provides role="menu" with keyboard navigation; NavHeadingMenuItem renders individual selectable items. Pass as the menu prop of SideNavHeading or TopNavHeading.

Open in Playground @astryxdesign/core/NavMenu

Showcases and examples

1 documented example

Nav Heading Menu

NavHeadingMenu passed as the menu prop of SideNavHeading, letting the heading act as a product switcher popover trigger.

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

'use client';

import {SideNav, SideNavHeading} from '@astryxdesign/core/SideNav';
import {NavHeadingMenu, NavHeadingMenuItem} from '@astryxdesign/core/NavMenu';

function AppIcon() {
  return (
    <svg
      width="20"
      height="20"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.5">
      <path
        strokeLinecap="round"
        strokeLinejoin="round"
        d="M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25a2.25 2.25 0 0 1-2.25-2.25v-2.25Z"
      />
    </svg>
  );
}

export default function NavHeadingMenuShowcase() {
  return (
    <div style={{height: 100}}>
      <SideNav
        header={
          <SideNavHeading
            heading="Acme Platform"
            icon={<AppIcon />}
            menu={
              <NavHeadingMenu size="lg">
                <NavHeadingMenuItem label="Dashboard" href="/dashboard" />
                <NavHeadingMenuItem label="Analytics" href="/analytics" />
                <NavHeadingMenuItem label="Settings" href="/settings" />
              </NavHeadingMenu>
            }
          />
        }>
        {null}
      </SideNav>
    </div>
  );
}

Usage

Accessible menu container and items for nav heading popovers. NavHeadingMenu provides role="menu" with keyboard navigation; NavHeadingMenuItem renders individual selectable items. Pass as the menu prop of SideNavHeading or TopNavHeading.

Typed props

PropType and behavior
childrenReactNode · required
Menu items.
size'sm' | 'md' | 'lg' · default 'md'
Controls min-width and item padding.
minWidthnumber | string
Minimum width override.
xstyleStyleXStyles
StyleX styles for layout customization (margins, positioning, sizing). Must be a stylex.create() value, not an inline style object like style={{}}.

Anatomy

Menu · required

Menu container for nav-heading actions, with menu semantics and keyboard navigation.

Item · required

Selectable action or navigation link inside the Menu.

Icon · optional

Optional Icon-rendered artwork shown before an Item label.

Text-rendered item label · optional

String Item label rendered through Text.

Caller-rendered item label · optional

Non-string Item label content rendered directly by the caller.

Item description · optional

Optional supporting description rendered through Text.

Theming

Targets

astryx-nav-heading-menu

Visual props: size

astryx-nav-heading-menu-item

Visual props: size