Navigation (secondary)
On this page
Overview
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.
Edit element properties
import '@rhds/elements/rh-navigation-secondary/rh-navigation-secondary.js';
import '@rhds/elements/rh-cta/rh-cta.js';
<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">
import { Cta } from "@rhds/elements/react/rh-cta/rh-cta.js";
import { NavigationSecondary } from "@rhds/elements/react/rh-navigation-secondary/rh-navigation-secondary.js";
import { NavigationSecondaryDropdown } from "@rhds/elements/react/rh-navigation-secondary-dropdown/rh-navigation-secondary-dropdown.js";
import { NavigationSecondaryMenu } from "@rhds/elements/react/rh-navigation-secondary-menu/rh-navigation-secondary-menu.js";
import { NavigationSecondaryMenuSection } from "@rhds/elements/react/rh-navigation-secondary-menu-section/rh-navigation-secondary-menu-section.js";
// NOTE: React 19+ does not require these wrapper imports.
// You can use the custom elements directly as-is.
export const Demo = () => (
<meta itemprop="description" content="Default secondary navigation demo with logo, nav links, dropdowns, and call to action." />
<NavigationSecondary>
<a href="#" slot="logo" id="logo-id" aria-current="page">Logo/Title</a>
<ul slot="nav" aria-labelledby="logo-id">
<li>
<NavigationSecondaryDropdown>
<a href="#dropdown-fallback-url" slot="link">Dropdown</a>
<NavigationSecondaryMenu slot="menu">
<NavigationSecondaryMenuSection>
<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>
<Cta slot="cta" href="#">Section CTA</Cta>
</NavigationSecondaryMenuSection>
<NavigationSecondaryMenuSection>
<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>
<Cta slot="cta" href="#">Section CTA</Cta>
</NavigationSecondaryMenuSection>
</NavigationSecondaryMenu>
</NavigationSecondaryDropdown>
</li>
<li>
<NavigationSecondaryDropdown>
<a href="#dropdown-fallback-url" slot="link">Dropdown</a>
<NavigationSecondaryMenu 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>
</NavigationSecondaryMenu>
</NavigationSecondaryDropdown>
</li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
<Cta slot="cta" href="#">Call to Action</Cta>
</NavigationSecondary>
<link rel="stylesheet" href="../rh-navigation-secondary-lightdom.css" />
);
Controls the visual color palette of the navigation bar. Valid values:
'lighter' (default) for light environments, 'dark' for dark
environments. Light-family values ('light', 'lightest') map to
'lighter'; dark-family values ('darker', 'darkest') map to 'dark'.
SHOULD match the surrounding page color scheme. Defaults to 'lighter'.
Sets the aria-label on the internal <nav> element for screen readers.
USE a descriptive label like the product name (e.g. "OpenShift navigation").
MUST be unique if multiple navigations exist on the page. Defaults to 'secondary'.
Status
- Figma library:
-
Ready - RH Elements:
-
Ready - RH Shared Libs:
-
Ready
When to use
- When you need to better organize a content structure
- When you need to provide a more granular navigation that is specific to a topic
- When you need to prevent other navigations from getting overloaded
Status checklist
| Property | Status | Meaning |
|---|---|---|
| Figma library |
|
Component is available in the Figma library |
| RH Elements |
|
Component is available in RH Elements |
| RH Shared Libs |
|
Component is available in RH Shared Libs |
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.