Navigation
A vertical sidebar of links and groups for moving around an app.
Usage
Navigation is the vertical sidebar for moving around an app. It holds Nav Item links, optionally clustered into a Nav Group, with a header and footer slot for branding and account controls. A Nav Toggle collapses and expands the sidebar on small screens.
Import the parts you need — each import registers its custom element:
import "@nordhealth/components/lib/Navigation"
import "@nordhealth/components/lib/NavItem"
import "@nordhealth/components/lib/NavGroup"
import "@nordhealth/components/lib/NavToggle"
Then list your navigation items:
Composition
Navigation contains nav items, optionally organised into groups, with header and footer slots.
Navigation
├── (slot="header")
├── NavItem
├── NavGroup
│ └── NavItem
└── (slot="footer")
<nord-navigation>
<nord-nav-item href="#" icon="interface-dashboard">Dashboard</nord-nav-item>
<nord-nav-group>
<nord-nav-item href="#">Settings</nord-nav-item>
</nord-nav-group>
</nord-navigation>
Navigation
Navigation is the sidebar container. Use its header and footer slots for branding and account controls, and sticky-footer to pin the footer to the bottom.
Nav Item
Nav Item is a single link. Give it an href, an optional icon, and mark the current page with active.
Nav Group
Nav Group clusters related nav items together so a section can be scanned — and collapsed — as a unit.
Nav Toggle
Nav Toggle is the control that collapses and expands the navigation on small screens.
Examples
Grouped items
Cluster related links with a Nav Group.
Basic
A flat list of Nav Item links, the simplest useful navigation.
Complex
Combine groups, icons and header and footer slots for a full application sidebar.
Initially open group
Expand a Nav Group by default so its items are visible on first load.
Sticky footer
Use sticky-footer to pin the footer slot to the bottom of the sidebar regardless of how many items it holds, shown here within a full app shell.
RTL
Navigation follows the document or container direction. Toggle the direction to see the layout mirror.
Accessibility
- Each Nav Item is a real link — use an
hrefso it behaves like one — and mark the current page withactiveso its state is conveyed. - Use Nav Group to give long lists of links a clear, scannable structure.
- Provide a Nav Toggle so the navigation can be collapsed on small screens without losing access to it.
Templates
See this component composed into complete application views:
API reference
Navigation
Navigation is used to display the primary navigation in the sidebar of an application. Navigation includes a list of links that users use to move between sections of the application.
<nord-navigation></nord-navigation>Props
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
stickyFooter | sticky-footer | Controls whether the navigations's footer has sticky positioning. | boolean | false |
Slots
| Slot name | Description |
|---|---|
Default slot | The main section of the sidebar, for holding nav components. |
header | The top section of the sidebar. |
footer | The bottom section of the sidebar. |
| Event | Detail Type | Description |
|---|---|---|
toggle | NordEvent | Dispatched whenever a nav item's state changes between open and closed. |
activate | NordEvent | Dispatched whenever a nav item has been marked as active |
CSS Properties
CSS Custom Properties provide more fine grain control over component presentation. We advise utilizing existing properties on the component before using these.
| Property | Description | Default |
|---|---|---|
--n-navigation-background-color | Controls the background color of the navigation element. | var(--n-color-nav-surface) |
--n-navigation-scroll-shadow-color-start | Color of the scroll-affordance shadow shown at the top of the scroll area (below the header) when sticky-footer is set. Set to transparent to disable. | rgb(0, 0, 0, 0.1) |
--n-navigation-scroll-shadow-color-end | Color of the scroll-affordance shadow shown at the bottom of the scroll area (above the footer) when sticky-footer is set. Set to transparent to disable. | rgb(0, 0, 0, 0.1) |
--n-navigation-scroll-mask | mask-image applied to the scrollable area when sticky-footer is set. Use with the shadow colors set to transparent to replace the dark scroll-shadow with a soft content fade at the edges. Example: linear-gradient(to bottom, transparent 0, black 24px, black calc(100% - 24px), transparent 100%). | none |
--n-navigation-padding-block | Block-axis (top/bottom) padding of the <nav> element that wraps the slotted nav groups. | var(--n-space-m) |
--n-navigation-padding-inline | Inline-axis (start/end) padding of the <nav> element that wraps the slotted nav groups. | var(--n-space-m) |
--n-navigation-footer-padding-block | Block-axis (top/bottom) padding inside the footer slot when sticky-footer is set. Has no visual effect when the footer slot is empty (slot is hidden in that case). | var(--n-space-s) |
--n-navigation-footer-padding-inline | Inline-axis (start/end) padding inside the footer slot when sticky-footer is set. Defaults to --n-navigation-padding-inline so the footer aligns with the nav content unless overridden. Has no visual effect when the footer slot is empty. | var(--n-navigation-padding-inline) |
Parts
This component is made up of the following parts.
Design guidelinesFor designers
Usage
This section includes guidelines for designers and developers about the usage of this component in different contexts.
Do
- Use for primary navigation items that perform an action when clicked. Each action should navigate to a URL or trigger another action like a modal overlay.
- 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 place a
<nav>element inside the navigation component, as it already contains one internally.
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):
Avoid unnecessary words and articles in item labels, such as “the”, “an” or “a”:
Avoid ending item labels in punctuation:
Use as few words as possible to describe each item label:
Avoid all caps for item labels and group titles: