Navigated to /docs/ui/components/navigation-menu

NavigationMenu

Horizontal or vertical destination list with current-page semantics.

Preview

A live, theme-aware example rendered with the published component.

Loading preview…

Import

Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.

TSX
tsximport { NavigationMenu } from "@tavojs/ui/navigation-menu";

Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/navigation-menu.

When to use

Use it when

Use NavigationMenu for persistent links between product or documentation sections, usually inside AppBar or Sidebar.

Choose something else when

Use DropdownMenu for contextual commands, Tabs for switching panels without navigation, and ToggleGroup for choosing a value.

Examples

NavigationMenu example

TSX
tsximport { NavigationMenu } from "@tavojs/ui/navigation-menu";

export function NavigationMenuExample1() {
  return (
    <>
      <NavigationMenu />
    </>
  );
}

Common props and defaults

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
itemsArray

Navigation items when supported by the component. Applies to NavigationMenu.
aria-labelstring

Accessible label for navigation landmarks when needed. Applies to NavigationMenu.
childrenChild

Navigation content or custom item structure. Applies to NavigationMenu.

Complete TypeScript API

Import from @tavojs/ui/navigation-menu. Published exports: NavigationMenu, NavigationMenuItem, NavigationMenuProps.

NavigationMenuProps

PropertyTypeRequiredDescription
childrenChild

No

Navigation content or custom item structure. Applies to NavigationMenu.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by NavigationMenu.

idstring

No

Inherited id attribute accepted by NavigationMenu.

rolestring

No

Inherited role attribute accepted by NavigationMenu.

styleRecord<string, unknown>

No

Inherited style attribute accepted by NavigationMenu.

titlestring

No

Inherited title attribute accepted by NavigationMenu.

tabIndexnumber

No

Inherited tabIndex attribute accepted by NavigationMenu.

hiddenboolean

No

Inherited hidden attribute accepted by NavigationMenu.

disabledboolean

No

Inherited disabled attribute accepted by NavigationMenu.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by NavigationMenu.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by NavigationMenu.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by NavigationMenu.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by NavigationMenu.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by NavigationMenu.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by NavigationMenu.

itemsNavigationMenuItem[]

No

Navigation items when supported by the component. Applies to NavigationMenu.

orientation"horizontal" | "vertical"

No

Inherited orientation attribute accepted by NavigationMenu.

State ownership and DOM target

ConcernContract
StateNo component state contract is exposed; the application owns the rendered content and surrounding behavior.
DOM targetPublic passthrough props target the component root. Treat nested elements and private class names as implementation details.

Anatomy and related components

This component exposes one public component root rather than a compound member API.

Limitations

Use DropdownMenu for contextual commands, Tabs for switching panels without navigation, and ToggleGroup for choosing a value.

Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.

Accessibility

Navigation components should expose current-page state and landmark labels when context is not obvious.

  • Use aria-current for active destinations where supported.

  • Add aria-label when multiple nav landmarks exist.

  • Keep link text descriptive.

Component status

ContractCurrent value
Maturitystable
Categorynavigation
Component import@tavojs/ui/navigation-menu
Explicit CSS import@tavojs/ui/css/navigation-menu
PreviewInteractive preview available on this page