Navigation (primary)
On this page
Importing
Add rh-navigation-primary to your page with this import statement:
<script type="module">
import '@rhds/elements/rh-navigation-primary/rh-navigation-primary.js';
</script>
Copy to Clipboard
Copied!
Wrap lines
Overflow lines
To learn more about installing RHDS elements on your site using an import map read our getting started docs.
Lightdom CSS
This element requires you to load "Lightdom CSS" stylesheets for styling deeply slotted elements.
Note
Replace /path/to/
with path to the CSS file, whether local or CDN.
<link rel="stylesheet" href="/path/to/rh-navigation-primary/rh-navigation-primary-lightdom.css">
Usage
rh-navigation-primary
Primary navigation helps users orient themselves and move through websites and domains.
Slot Name | Summary | Description |
---|---|---|
logo |
Use this slot to override the link and logo image for translations and sub sites. |
|
|
Use this slot for |
|
event |
||
links |
||
dropdowns |
Attribute | DOM Property | Description | Type | Default |
---|---|---|---|---|
mobile-toggle-label |
mobileToggleLabel |
Sets the mobile toggle (hamburger) text, used for translations, defaults to 'Menu' |
|
|
color-palette |
colorPalette |
Sets color context for child components, overrides parent context |
|
|
accessible-label |
accessibleLabel |
Customize the default |
|
|
Method Name | Description |
---|---|
close() |
Close Menus |
CSS Property | Description | Default |
---|---|---|
--rh-navigation-primary-z-index |
102
|
Token | Copy |
---|---|
--rh-color-brand-red-light
|
|
--rh-color-purple-40
|
|
--rh-color-purple-60
|
|
--rh-font-family-body-text
|
|
--rh-color-surface-lightest
|
|
--rh-color-surface-darkest
|
|
--rh-color-text-primary
|
|
--rh-border-radius-default
|
|
--rh-border-radius-pill
|
|
--rh-color-surface-lighter
|
|
--rh-color-surface-darker
|
|
--rh-color-interactive-primary-default
|
|
--rh-color-gray-40
|
|
--rh-color-icon-subtle
|
|
--rh-color-icon-secondary
|
|
--rh-font-size-body-text-sm
|
|
--rh-border-width-md
|
|
--rh-space-xs
|
|
--rh-space-md
|
|
--rh-color-surface
|
|
--rh-space-lg
|
|
--rh-box-shadow-sm
|
|
--rh-space-2xl
|
|
--rh-border-width-sm
|
|
--rh-color-border-subtle
|
|
rh-navigation-primary-item-menu
Navigation Menu
Slot Name | Summary | Description |
---|---|---|
|
Place element content here |
Token | Copy |
---|---|
--rh-color-text-primary
|
|
--rh-color-surface
|
|
--rh-space-xl
|
|
--rh-space-3xl
|
|
--rh-space-2xl
|
|
rh-navigation-primary-item
Slot Name | Summary | Description |
---|---|---|
icon |
||
summary |
||
|
Attribute | DOM Property | Description | Type | Default |
---|---|---|---|---|
open |
open |
|
|
|
summary |
summary |
|
|
|
variant |
variant |
|
|
|
hide-at |
hideAt |
Hides the element at various container query based breakpoints. Breakpoints available 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' |
|
|
icon |
icon |
Shorthand for the |
|
|
icon-set |
iconSet |
Icon set for the |
|
|
Method Name | Description |
---|---|
hide() |
|
show() |
Token | Copy |
---|---|
--rh-size-icon-02
|
|
--rh-space-sm
|
|
--rh-color-icon-subtle
|
|
--rh-border-width-lg
|
|
--rh-color-accent-brand
|
|
--rh-color-border-subtle
|
|
--rh-border-radius-pill
|
|
--rh-border-width-sm
|
|
--rh-color-surface
|
|
--rh-color-surface-lighter
|
|
--rh-color-surface-darker
|
|
--rh-color-text-primary
|
|
--rh-color-gray-50
|
|
--rh-color-gray-40
|
|
--rh-color-interactive-primary-hover
|
|
--rh-font-size-body-text-md
|
|
--rh-space-xl
|
|
--rh-space-lg
|
|
--rh-font-size-body-text-sm
|
|
--rh-space-md
|
|
--rh-border-width-md
|
|
--rh-color-interactive-primary-default
|
|
--rh-border-radius-default
|
|
rh-navigation-primary-overlay
Overlay
Slot Name | Summary | Description |
---|---|---|
|
Place element content here |
Attribute | DOM Property | Description | Type | Default |
---|---|---|---|---|
open |
open |
|
|
CSS Property | Description | Default |
---|---|---|
--rh-overlay-z-index |
1
|
Token | Copy |
---|---|
--rh-color-gray-90
|
|
--rh-opacity-80
|
|
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.