Skip to content
Alea0.1

Navigation

NavigationMenu

A site header navigation with dropdown panels of links: mega menus with icons and descriptions.

Ant Design: Menu mode="horizontal" with submenus

import { NavigationMenu } from '@alea/ui';

Examples

Links only

Without panels it's a simple, accessible header nav.

Props

NavigationMenu props

A site header navigation with dropdown panels (mega menus), using the disclosure pattern: buttons open panels of links (Radix NavigationMenu, Ant Menu horizontal).

PropTypeDefaultDescription
itemsrequired(NavLinkItem | { label: string; items: NavLinkItem[]; footer?: ReactNode; })[]-Links, or groups that open a panel of links.
aria-labelstring-Name of the navigation. Default "Main".
classNamestring-Extra class names for the root element.
currentstring-The href of the current page (gets aria-current).

Accessibility

  • The disclosure pattern: buttons with aria-expanded open panels of plain links, which is what screen reader users expect from site navigation.
  • The current page has aria-current.

Keyboard

KeyDoes
TabMoves through items and open panels
Enter or SpaceOpens a panel
EscapeCloses it and returns focus

Do and don't

Do

  • Give each link a short description in mega menus.
  • Mark the current page.

Don't

  • Don't nest panels inside panels.
  • Don't open panels on hover only: they open on click and keyboard.
Tested with axe, keyboard and screen reader roles