React playground

Nova v3.37.0

Preview

React

Navbar

nv-navbar

Navigation between application destinations, with a current page and optional notification counts.

Parts

Live demo

Use a navbar for the main destinations in a product. It groups links in a horizontal row and highlights the current page. This demo keeps navigation local so you can try each destination without leaving the preview.

Anatomy

A navbar with six callouts: 1 marks the current item, 2 its leading icon, 3 its label, 4 its notification count, 5 its trailing icon, and 6 another destination.

The parts of a navbar, following the design reference.
  1. Current item (nv-navbar-item) identifies the open destination with its active background and current state.
  2. Leading icon is optional; set leadingIcon to a Nova icon name.
  3. Label names the destination. Keep it visible and concise.
  4. Notification displays a count from notification. Values below 1 leave the badge out.
  5. Trailing icon is optional; set it with trailingIcon.
  6. Default item is another link in the container's default slot.

Composing destinations

Place nv-navbar-item children directly in nv-navbar. Each item needs a label and href. The application router sets current after navigation; clicking an item does not choose the active route for you. Keep one item current, or none when the page belongs outside this group.

Design settingComponent API
ItemsDefault slot of nv-navbar, containing nv-navbar-item children
Active destinationcurrent on the matching item
Unavailable destinationdisabled on the item
IconsleadingIcon and trailingIcon on the item
Notification countnotification, with a translated notificationLabel

The design's menu setting has no implementation in this release. Use links for destinations and keep dropdown indicators out of the navbar.

States and themes

Enabled items have default, hover and keyboard-focus appearances. The current page uses the active treatment; disabled dims an unavailable item and removes its destination and tab stop. Labels, icons and counts follow the item state in Spark and Ocean, in light and dark mode.

default · current · disabled

The design source records an active-label contrast issue in Spark light (4.41:1 against its 4.5:1 target). Include that state in accessibility reviews; the source page tracks the design guidance.

Layout and accessibility

The navbar fills the space its container provides and wraps whole items in their original order. It has no automatic mobile collapse or overflow menu. Keep labels short and choose the destinations that belong in the main navigation.

The component supplies a navigation landmark and a list of native links. Name the landmark with aria-label or aria-labelledby. The current link exposes aria-current="page". Tab and Shift+Tab visit enabled links; Enter follows one. Native link actions, including opening a new tab, remain available.

Icons are decorative. notificationLabel supplies a separate accessible description, with {count} replaced by the count, so a badge does not change the destination's name. Translate this text with the application.

DoUse short destination names and one current page.
Don'tAvoid marking several destinations as current.

Use Tabs for related views within a page and Sidebar for vertical application navigation.

Sources