NavItem

OverviewExamplesPropertiesSlotsMethodsEventsUsageIntegration

Navigation item populates sidebar navigation with links. Every item should be placed inside a navigation group.

Properties

PropertyAttribute Description TypeDefault
activeactiveUsed for indicating the current page. This gives a prominent background to the nav item, and marks the item as the current page for assistive technology.booleanfalse
iconiconThe name of an icon from Nordicons to display for the nav item.string | undefined
hrefhrefThe url the nav item should link to. Note: this is not used if you have nested navigation using the "subnav" slot.string | undefined
badgebadgeAllows you to add a notification badge with a number next to the nav item.string | undefined
openopenWhen the nav items contains a subnav, controls whether the section is expanded or not. Note: this is only used if you have nested navigation using the "subnav" slot.booleanfalse

Slots

Slot name Description
Default slotThe default slot used for the nav item's text.
subnavUsed for nesting navigation. When used the nav-item becomes a button to collapse the subnav, rather than a link.

Methods

Method nameParameters Description
focus(options?: FocusOptions) => voidoptions: An object which controls aspects of the focusing process.Programmatically move focus to the component.
blur() => voidN/AProgrammatically remove focus from the component.
click() => voidN/AProgrammatically simulates a click on the component.
EventDetail TypeDescription
toggleNordEventDispatched whenever a nav item's state changes between open and closed.
activateNordEventDispatched whenever a nav item has been marked as active

This component has no CSS custom properties.

Usage

This section includes guidelines for designers and developers about the usage of this component in different contexts.

Do

  • Group navigation items into navigation groups based on related categories.
  • Use group headings to clarify the category of a section.
  • Use icons for all top level navigation items.

Don’t

  • Don’t use navigation item outside of navigation group and navigation components.

Content guidelines

When writing navigation item labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):

My tasks
My Tasks

Avoid unnecessary words and articles in item labels, such as “the”, “an” or “a”:

Change theme
Change the theme

Avoid ending item labels in punctuation:

Switch user
Switch user.

Use as few words as possible to describe each item label:

Payments
Payments in your clinic

Avoid all caps for item labels and group titles:

Dashboard
DASHBOARD

Integration

For integration guidelines, please see Web Components documentation .

Was this page helpful?

Yes No

We use this feedback to improve our documentation.