Home

Site Layout NavMenu Component

Top-level navigation menu bar

Displays horizontal navigation with mega-dropdown panels on desktop and accordion-style menu on mobile. Uses site.nav as data source, e.g.

# Header nav menu with defaults and overrides
[site.layout.header]
middle = "nav-menu"  # Uses defaults

# Or with configuration:
middle = { type = "nav-menu", groups = "dropdowns", trigger = "click" }

include

Type: array (optional)

Include only items matching these patterns

Supports routes ("/docs/*"), IDs ("#features"), and labels ("Features").

exclude

Type: array (optional)

Exclude items matching these patterns

Supports routes ("/docs/*"), IDs ("#features"), and labels ("Features"). Exclude takes precedence over include.

depth

Type: integer (optional)

Maximum depth to display (1 = top-level only)

Limits how deep the navigation menu renders. Horizontal dropdown menus work best with shallow hierarchies.

Default: 2

groups

Type: NavMenuGroups (optional)

How to render groups

Default: auto

ValueDescription
autoGroups with children become dropdowns, others are links (default)
dropdownsAll groups become dropdown menus
linksAll groups render as simple links (requires route)

icons

Type: NavMenuIcons (optional)

Whether to show icons

Default: show

ValueDescription
showShow icons on all items that have them (default)
hideNever show icons
dropdownsOnly show icons inside dropdown panels

descriptions

Type: boolean (optional)

Whether to show descriptions in dropdowns

Default: true

trigger

Type: NavMenuTrigger (optional)

Dropdown trigger behavior

Default: hover

ValueDescription
hoverOpen dropdowns on hover with delay (default)
clickOpen dropdowns on click only

dropdown-style

Type: NavMenuDropdownStyle (optional)

Dropdown panel style

Default: full-width

ValueDescription
full-widthFull-width dropdown panels (default)
alignedDropdown aligned to trigger position

This documentation was generated from layout/components.rs by generate.rs.

© 2026 Stencila