Nav

The Nav component provides a reusable pattern for nav in the interface.

Vertical navigation

Vertical navigation (with border)

Vertical navigation (with border and indented)

Horizontal navigation

Horizontal navigation (with dropdown)

Compressed vertical navigation

Vertical navigation with reduced spacing between items using the compressed parameter.

Horizontal navigation (extended dropdown)

Horizontal navigation with the extended mega-menu dropdown enabled via isExtendedDropdown, presenting child items in a full-width panel.

Navigation with tile-style items

Horizontal navigation where each item uses the tiles style, rendering links as card-like tiles with an icon and label.

Navigation with button-style items

Navigation mixing button-style items with default links, demonstrating how individual items can be rendered as filled or outlined buttons.

Vertical navigation with active and ancestor state

Vertical navigation with a current-page item (active) and its expanded parent (ancestor), showing how the component highlights the active trail.

API

Parameter Default Description
[] An nested array of items containing: id, label, active, ancestor, children(bool = async loading, or array), href, style, class, and color (which overrides the color settings). Attribute list may also contain 'data-fetch-url' to enable asyncrounous fetching.
vertical Modifier for basic direction. Accept values: 'vertical', 'horizontal.'
false Tells wheter to include toggle button to expand childs or not. Accept values: true, false.
false If true, the nav will be presented as an extended dropdown menu. Should only be used for top level horizontal navs.
true Allow the use of style parameter in this menu (item.style = 'button')
filled If the nav is presenting buttons, what style they should be in.
primary If the nav is presenting buttons, what color they should be in.
Expand Prefix for labels on expand arrow. Will result in Expand: Link label, or if label is missing, just Expand.
The default height of the menu (only supports horizontal navigation). Values: sm, md, lg.
false Makes the spacing between items smaller and the overall navigation more compressed.
expand_more The icon to use for the expand button. Accepts any icon name from the icon library or svg.
false If true, sublevels will be indented.

CSS API

Variable Default Type Values Description
var(--base) range - Main unit that drives radius and spacing scales.
var(--border-radius) range - Border Radius
var(--color--surface) color - Surface
var(--color--primary) color - Primary
var(--shadow-color) rgba - Shadow Color
var(--shadow-amount) range - Multiplier for elevation shadows. 0 = none, 1 = default.
var(--color--primary-contrast) color - Primary Contrast
var(--color--surface-border) color - Manual companion token for borders on surface elements.
var(--color--surface-contrast) color - Used for text and icons on surface backgrounds with less contrast.

Similar components