Skip to main content Home
About About the Design SystemRoadmap
Get started OverviewDesignersDevelopers
Foundations OverviewColorGridIconographyInteractionsSpacingTypography
Tokens Overview Global colorbox shadowTypographyborderopacityspacelengthIconBreakpointsMedia Queries
Elements All elements Accordion Alert Announcement Audio player Avatar Back to top Badge Blockquote Breadcrumb Button Card Chip Code block Call to action Dialog Disclosure Footer Health index Icon Jump links Navigation (primary) Navigation (secondary) Pagination PopoverPlanned Progress stepper Scheme toggle Site status Skeleton Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed
Theming OverviewColor PalettesCustomizingDevelopers
Patterns All PatternsCardFilterFormLink with iconLogo wallSearch barSticky bannerSticky cardTabsTagTile
Personalization All Personalization PatternsAnnouncement
Accessibility FundamentalsAccessibility toolsAssistive technologiesCI/CDContentContributorsDesignDevelopmentManual testingResourcesScreen readers
Design/code status Release notes Get support

Navigation (primary)

OverviewStyleGuidelinesCodeAccessibilityDemos
ImportingUsagerh-navigation-primaryrh-navigation-primary-item-menurh-navigation-primary-itemrh-navigation-primary-overlayImportingUsagerh-navigation-primaryrh-navigation-primary-item-menurh-navigation-primary-itemrh-navigation-primary-overlay

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 Wrap 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.

Slots 5
Slot Name Summary Description
logo

Use this slot to override the link and logo image for translations and sub sites.

Use this slot for <rh-primary-navigation-item> hamburger menu links and dropdowns

event
links
dropdowns
Attributes 3
Attribute DOM Property Description Type Default
mobile-toggle-label mobileToggleLabel

Sets the mobile toggle (hamburger) text, used for translations, defaults to 'Menu'

string
'Menu'
color-palette colorPalette

Sets color context for child components, overrides parent context

NavigationPrimaryPalette
unknown
accessible-label accessibleLabel

Customize the default aria-label on the <nav> container. Defaults to "main" if no attribute/property is set.

string
'main'
Methods 1
Method Name Description
close()

Close Menus

Events 0
None
CSS Shadow Parts 0
None
CSS Custom Properties 1
CSS Property Description Default
--rh-navigation-primary-z-index 102
Design Tokens 25
Token Copy
--rh-color-brand-red-light
Full CSS Variable Permalink to this token
--rh-color-purple-40
Full CSS Variable Permalink to this token
--rh-color-purple-60
Full CSS Variable Permalink to this token
--rh-font-family-body-text
Full CSS Variable Permalink to this token
--rh-color-surface-lightest
Full CSS Variable Permalink to this token
--rh-color-surface-darkest
Full CSS Variable Permalink to this token
--rh-color-text-primary
Full CSS Variable Permalink to this token
--rh-border-radius-default
Full CSS Variable Permalink to this token
--rh-border-radius-pill
Full CSS Variable Permalink to this token
--rh-color-surface-lighter
Full CSS Variable Permalink to this token
--rh-color-surface-darker
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-default
Full CSS Variable Permalink to this token
--rh-color-gray-40
Full CSS Variable Permalink to this token
--rh-color-icon-subtle
Full CSS Variable Permalink to this token
--rh-color-icon-secondary
Full CSS Variable Permalink to this token
--rh-font-size-body-text-sm
Full CSS Variable Permalink to this token
--rh-border-width-md
Full CSS Variable Permalink to this token
--rh-space-xs
Full CSS Variable Permalink to this token
--rh-space-md
Full CSS Variable Permalink to this token
--rh-color-surface
Full CSS Variable Permalink to this token
--rh-space-lg
Full CSS Variable Permalink to this token
--rh-box-shadow-sm
Full CSS Variable Permalink to this token
--rh-space-2xl
Full CSS Variable Permalink to this token
--rh-border-width-sm
Full CSS Variable Permalink to this token
--rh-color-border-subtle
Full CSS Variable Permalink to this token

rh-navigation-primary-item-menu

Navigation Menu

Slots 1
Slot Name Summary Description

Place element content here

Attributes 0
None
Methods 0
None
Events 0
None
CSS Shadow Parts 0
None
CSS Custom Properties 0
None
Design Tokens 5
Token Copy
--rh-color-text-primary
Full CSS Variable Permalink to this token
--rh-color-surface
Full CSS Variable Permalink to this token
--rh-space-xl
Full CSS Variable Permalink to this token
--rh-space-3xl
Full CSS Variable Permalink to this token
--rh-space-2xl
Full CSS Variable Permalink to this token

rh-navigation-primary-item

Slots 3
Slot Name Summary Description
icon
summary
Attributes 6
Attribute DOM Property Description Type Default
open open
boolean
false
summary summary
string
unknown
variant variant
'link' | 'dropdown'
'link'
hide-at hideAt

Hides the element at various container query based breakpoints. Breakpoints available 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'

'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
undefined
icon icon

Shorthand for the icon slot, the value is icon name

IconNameFor<IconSetName>
unknown
icon-set iconSet

Icon set for the icon property - 'ui' by default

IconSetName
unknown
Methods 2
Method Name Description
hide()
show()
Events 0
None
CSS Shadow Parts 0
None
CSS Custom Properties 0
None
Design Tokens 23
Token Copy
--rh-size-icon-02
Full CSS Variable Permalink to this token
--rh-space-sm
Full CSS Variable Permalink to this token
--rh-color-icon-subtle
Full CSS Variable Permalink to this token
--rh-border-width-lg
Full CSS Variable Permalink to this token
--rh-color-accent-brand
Full CSS Variable Permalink to this token
--rh-color-border-subtle
Full CSS Variable Permalink to this token
--rh-border-radius-pill
Full CSS Variable Permalink to this token
--rh-border-width-sm
Full CSS Variable Permalink to this token
--rh-color-surface
Full CSS Variable Permalink to this token
--rh-color-surface-lighter
Full CSS Variable Permalink to this token
--rh-color-surface-darker
Full CSS Variable Permalink to this token
--rh-color-text-primary
Full CSS Variable Permalink to this token
--rh-color-gray-50
Full CSS Variable Permalink to this token
--rh-color-gray-40
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-hover
Full CSS Variable Permalink to this token
--rh-font-size-body-text-md
Full CSS Variable Permalink to this token
--rh-space-xl
Full CSS Variable Permalink to this token
--rh-space-lg
Full CSS Variable Permalink to this token
--rh-font-size-body-text-sm
Full CSS Variable Permalink to this token
--rh-space-md
Full CSS Variable Permalink to this token
--rh-border-width-md
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-default
Full CSS Variable Permalink to this token
--rh-border-radius-default
Full CSS Variable Permalink to this token

rh-navigation-primary-overlay

Overlay

Slots 1
Slot Name Summary Description

Place element content here

Attributes 1
Attribute DOM Property Description Type Default
open open
boolean
false
Methods 0
None
Events 0
None
CSS Shadow Parts 0
None
CSS Custom Properties 1
CSS Property Description Default
--rh-overlay-z-index 1
Design Tokens 2
Token Copy
--rh-color-gray-90
Full CSS Variable Permalink to this token
--rh-opacity-80
Full CSS Variable Permalink to this token
© 2025 Red Hat Deploys by Netlify