Navigation (secondary)
On this page
Importing
Add rh-navigation-secondary to your page with this import statement:
<script type="module">
import '@rhds/elements/rh-navigation-secondary/rh-navigation-secondary.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-secondary/rh-navigation-secondary-lightdom.css">
Usage
<meta itemprop="description" content="Default secondary navigation demo with logo, nav links, dropdowns, and call to action.">
<rh-navigation-secondary>
<a href="#" slot="logo" id="logo-id" aria-current="page">
Logo/Title
</a>
<ul slot="nav" aria-labelledby="logo-id">
<li>
<rh-navigation-secondary-dropdown>
<a href="#dropdown-fallback-url" slot="link">Dropdown</a>
<rh-navigation-secondary-menu slot="menu">
<rh-navigation-secondary-menu-section>
<h3 slot="header">Section</h3>
<ul slot="links">
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
<rh-cta slot="cta" href="#">Section CTA</rh-cta>
</rh-navigation-secondary-menu-section>
<rh-navigation-secondary-menu-section>
<h3 slot="header">Section</h3>
<ul slot="links">
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
<rh-cta slot="cta" href="#">Section CTA</rh-cta>
</rh-navigation-secondary-menu-section>
</rh-navigation-secondary-menu>
</rh-navigation-secondary-dropdown>
</li>
<li>
<rh-navigation-secondary-dropdown>
<a href="#dropdown-fallback-url" slot="link">Dropdown</a>
<rh-navigation-secondary-menu slot="menu">
<ul>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
</rh-navigation-secondary-menu>
</rh-navigation-secondary-dropdown>
</li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
<rh-cta slot="cta" href="#">Call to Action</rh-cta>
</rh-navigation-secondary>
<link rel="stylesheet" href="../rh-navigation-secondary-lightdom.css">
<script type="module">
import '@rhds/elements/rh-navigation-secondary/rh-navigation-secondary.js';
import '@rhds/elements/rh-cta/rh-cta.js';
</script>
Copy to Clipboard
Copied!
Wrap lines
Overflow lines
System Integration
Current page indicator
When a user is viewing a page that is part of the secondary navigation information architecture, a red top border is visible. If the current active page is part of a dropdown menu, that dropdown is highlighted with the same top border to indicate it contains the current page. For more details on how to use this current page indicator, refer to the design guidelines for current page indicator.
To enable this indicator style, implementation should apply the
aria-current="page" attribute to the current page link.
<a href="/" aria-current="page">Current page being viewed</a>
The rh-navigation-secondary element does not apply the
aria-current="page" attribute itself. The responsibility for
keeping track of which link is currently active falls on the content management
system or application. The element checks for the presence of this attribute
and applies the current page indicator style to nav links and dropdown menus
when the active page is within a dropdown menu.
rh-navigation-secondary
Connects a series of related pages with persistent wayfinding navigation
below the primary nav. Uses role="navigation" with a configurable
aria-label. Supports light and dark color palettes. On mobile, nav
items collapse behind a hamburger menu button. Keyboard: Tab moves
between links/dropdowns, Escape closes expanded menus and mobile menu,
Enter/Space toggles dropdown expansion. MUST be used with <rh-navigation-primary>
above it. SHOULD contain a logo slot, nav slot with <ul>, and
optional cta slot. AVOID more than 5 nav items.
Slots
4
| Slot Name | Summary | Description |
|---|---|---|
product logo or name link |
Expects an |
|
mobile menu button label |
Text label for the mobile hamburger menu button. Defaults to "Menu". USE this slot for localization/translation of the button text. Screen readers announce this label with the button's expanded state. |
|
navigation link list |
Expects a |
|
navigation-level call to action |
Optional slot for an |
Attributes
2
| Attribute | DOM Property | Description | Type | Default |
|---|---|---|---|---|
|
|
colorPalette |
Controls the visual color palette of the navigation bar. Valid values:
|
|
|
|
|
accessibleLabel |
Sets the |
|
|
Methods
3
| Method Name | Description |
|---|---|
|
|
|
|
|
Opens a specific dropdown based on index. Closes all open dropdowns before opening specified. Toggles overlay to open |
|
|
Closes all open dropdowns |
Events
1
| Event Name | Description |
|---|---|
|
|
Fires when a dropdown opens/closes
in desktop view or mobile menu toggles. Detail: |
CSS Shadow Parts
3
| Part Name | Summary | Description |
|---|---|---|
|
|
main navigation wrapper element |
The outermost container for the secondary navigation, wrapping all navigation content
including logo, menu, and CTA. This part corresponds to a Styling:
@see Navigation documentation |
|
|
navigation content container |
The primary container for navigation links, logo, mobile menu button, and CTA.
This part corresponds to a Styling:
@see Navigation documentation |
|
|
call-to-action container |
Container for the navigation-level call-to-action button. This part corresponds
to a Styling:
@see Navigation documentation |
CSS Custom Properties
1
| CSS Property | Description | Default |
|---|---|---|
--rh-navigation-secondary-z-index |
--rh-navigation-secondary-z-index Controls the stacking order of the secondary navigation bar. Defaults to 102 to ensure navigation appears above most page content but below modals and overlays. Usage guidelines:
z-index of the navigation-secondary |
102
|
Design Tokens
17
| Token | Description | Copy |
|---|---|---|
--rh-color-text-primary
|
|
|
--rh-color-brand-red
|
|
|
--rh-color-border-subtle
|
|
|
--rh-color-surface-lighter
|
Tertiary surface (light theme) |
|
--rh-color-surface-dark
|
Tertiary surface (dark theme) |
|
--rh-border-width-sm
|
1px border width; Example: Secondary CTA or Button |
|
--rh-font-family-body-text
|
Navigation typeface Body text font family |
|
--rh-font-size-body-text-md
|
Navigation text size 16px font size |
|
--rh-border-width-lg
|
Navigation top border 3px border width: Example: Expanded Accordion panel |
|
--rh-space-lg
|
Navigation content gap Navigation inner spacing Navigation end margin 16px spacer |
|
--rh-space-md
|
Navigation content gap 8px spacer |
|
--rh-color-surface
|
Navigation background |
|
--rh-color-surface-lightest
|
Primary surface (light theme) |
|
--rh-color-text-brand-on-light
|
Navigation top accent color Navigation top accent color Brand text color for light theme |
|
--rh-color-text-primary-on-dark
|
Primary text color for dark theme |
|
--rh-color-text-primary-on-light
|
Primary text color for light theme |
|
--rh-space-2xl
|
Navigation end margin Navigation inner spacing 32px spacer |
|
rh-navigation-secondary-dropdown
Wraps a top-level nav link to add expandable dropdown menu functionality.
Upgrades the slotted <a> with role="button", aria-expanded, and
aria-controls for accessibility. Highlights with a red top border when
the dropdown contains the current page (aria-current="page"). Keyboard:
Enter/Space toggles the dropdown; Tab moves through menu items; Escape
closes. MUST contain an <a> in the link slot and an
<rh-navigation-secondary-menu> in the menu slot.
Slots
2
| Slot Name | Summary | Description |
|---|---|---|
dropdown trigger link |
Expects an |
|
dropdown menu panel |
Expects an |
Attributes
0
None
Methods
0
None
Events
1
| Event Name | Description |
|---|---|
|
|
Fires when the dropdown link is
clicked. Detail: |
CSS Shadow Parts
1
| Part Name | Summary | Description |
|---|---|---|
|
|
dropdown wrapper container |
The container for a navigation dropdown item, wrapping both the link and menu.
This part corresponds to a Styling:
@see Navigation documentation |
CSS Custom Properties
0
None
Design Tokens
10
| Token | Description | Copy |
|---|---|---|
--rh-border-width-lg
|
Navigation leading border 3px border width: Example: Expanded Accordion panel |
|
--rh-border-width-sm
|
Navigation trailing border 1px border width; Example: Secondary CTA or Button |
|
--rh-color-border-subtle-on-light
|
Navigation trailing border color Subtle border color (light theme) |
|
--rh-box-shadow-sm
|
Navigation elevation shadow Small box shadow |
|
--rh-color-text-primary
|
|
|
--rh-font-size-body-text-md
|
16px font size |
|
--rh-color-surface
|
Navigation background |
|
--rh-color-text-brand-on-light
|
Navigation leading border color Navigation top accent color Brand text color for light theme |
|
--rh-color-surface-lightest
|
Navigation background Primary surface (light theme) |
|
--rh-color-text-primary-on-light
|
Primary text color for light theme |
|
rh-navigation-secondary-menu-section
Groups related links under a heading within a dropdown menu. Automatically
wires aria-labelledby between the slotted heading and adjacent <ul>/<ol>
for screen reader navigation. Renders as a <section> element. MUST contain
a heading in the header slot and a list in the links slot. SHOULD
provide an id on the heading or one will be auto-generated. Tab navigates
through links; the heading provides group context to assistive technology.
Slots
3
| Slot Name | Summary | Description |
|---|---|---|
section heading |
Expects an |
|
section link list |
Expects a |
|
section-level call to action |
Optional slot for an |
Attributes
0
None
Methods
0
None
Events
0
None
CSS Shadow Parts
1
| Part Name | Summary | Description |
|---|---|---|
|
|
menu section container |
The semantic container for a menu section, grouping related navigation links
under a common header. This part corresponds to a Styling:
Accessibility:
@see Navigation documentation |
CSS Custom Properties
0
None
Design Tokens
3
| Token | Description | Copy |
|---|---|---|
--rh-font-family-heading
|
Navigation typeface Heading font family |
|
--rh-font-size-body-text-md
|
Navigation content gap 16px font size |
|
--rh-space-xl
|
Navigation inner spacing Navigation inner spacing 24px spacer |
|
rh-navigation-secondary-menu
The expandable dropdown menu panel for secondary navigation. Supports
full-width (default) and fixed-width layouts. Contains
<rh-navigation-secondary-menu-section> children organized in a CSS grid.
Always renders on the lightest color palette. Visibility is toggled by the
parent <rh-navigation-secondary-dropdown>. MUST be placed inside the
menu slot of a dropdown. Tab navigates through menu content; Escape
closes the menu. Screen readers access content via section headings.
Slots
1
| Slot Name | Summary | Description |
|---|---|---|
|
Optional |
Attributes
3
| Attribute | DOM Property | Description | Type | Default |
|---|---|---|---|---|
|
|
colorPalette |
Color palette for the menu panel surface. SHOULD remain |
|
|
|
|
layout |
Controls the menu panel width. |
|
|
|
|
visible |
Controls whether the menu panel is visible. Managed automatically by the
parent |
|
|
Methods
0
None
Events
0
None
CSS Shadow Parts
3
| Part Name | Summary | Description |
|---|---|---|
|
|
container - |
|
|
|
container - |
|
|
|
container - |
CSS Custom Properties
3
| CSS Property | Description | Default |
|---|---|---|
--rh-navigation-secondary-menu-section-grid |
repeat(auto-fit,
minmax(15.5rem, 1fr))
|
|
--rh-navigation-secondary-menu-section-grid-gap |
var(--rh-space-2xl, 32px)
|
|
--rh-navigation-secondary-menu-content-max-width |
Navigation maximum width |
1136px
|
Design Tokens
8
| Token | Description | Copy |
|---|---|---|
--rh-color-text-primary-on-light
|
Navigation text color Primary text color for light theme |
|
--rh-color-surface-lightest
|
Navigation background Primary surface (light theme) |
|
--rh-space-xl
|
Navigation inner spacing 24px spacer |
|
--rh-font-size-body-text-md
|
Navigation content gap 16px font size |
|
--rh-box-shadow-sm
|
Navigation elevation shadow Small box shadow |
|
--rh-space-2xl
|
32px spacer |
|
--rh-space-3xl
|
48px spacer |
|
--rh-space-4xl
|
64px spacer |
|
rh-navigation-secondary-overlay
Semi-transparent backdrop overlay that dims page content when a secondary
navigation dropdown or mobile menu is expanded. Clicking the overlay closes
all open menus. Managed automatically by <rh-navigation-secondary>.
AVOID using standalone. Screen readers SHOULD ignore this element as it
serves a purely visual purpose. Keyboard: Escape closes the overlay.
Slots
0
Attributes
1
| Attribute | DOM Property | Description | Type | Default |
|---|---|---|---|---|
|
|
open |
Controls the visibility of the navigation overlay. When Usage guidelines
Accessibility
|
|
|
Methods
0
None
Events
0
None
CSS Shadow Parts
0
None
CSS Custom Properties
1
1
| CSS Property | Description | Default |
|---|---|---|
--rh-navigation-secondary-overlay-z-index |
z-index of the navigation-secondary-overlay |
var(--rh-secondary-nav-overlay-z-index, -1)
|
Deprecated CSS Custom Properties
| CSS Property | Description | Default | Reason |
|---|---|---|---|
--rh-secondary-nav-overlay-z-index |
-1 |
use --rh-navigation-secondary-overlay-z-index |
Design Tokens
2
| Token | Description | Copy |
|---|---|---|
--rh-color-gray-90
|
Secondary surface (dark theme) |
|
--rh-opacity-80
|
80% opacity |
|
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.