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 drawer Navigation (primary) Navigation (secondary) Pagination PopoverPlanned Progress stepsPlanned Site status Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed
Theming OverviewColor PalettesCustomizingDevelopers
Patterns All PatternsCardTabsFilterFormLink with iconLogo wallSearch barSticky bannerSticky cardTile
Personalization All Personalization PatternsAnnouncement
Accessibility FundamentalsAccessibility toolsAssistive technologiesCI/CDContentContributorsDesignDevelopmentManual testingResourcesScreen readers
Design/code status Release notes Get support

Navigation drawer

OverviewStyleGuidelinesCodeAccessibilityDemos
ImportingUsagerh-navigation-drawerImportingUsagerh-navigation-drawer

Importing

Add rh-navigation-drawer to your page with this import statement:

<script type="module">
  import '@rhds/elements/rh-navigation-drawer/rh-navigation-drawer.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.

Usage

<!-- A parent container element with container-type: inline-size is required -->
<div class="container">
  <rh-navigation-drawer>
    Drawer content
  </rh-navigation-drawer>
</div>

<script type="module">
  import '@rhds/elements/rh-navigation-drawer/rh-navigation-drawer.js';
</script>

<style>
  .container {
    container-type: inline-size;
    height: 100%;
  }
</style>
Copy to Clipboard Wrap lines

rh-navigation-drawer

Navigation Drawer is a component that displays a navigation menu in a vertical drawer in wide viewports and a disclosure in narrow viewports.

Slots 3
Slot Name Description

Drawer content such as vertical navigation elements

header

(optional) header content such as titles and filters

footer

(optional) Footer content such as links and copyright info

Attributes 6
Attribute DOM Property Description Type Default
container container

The selector for the element to observe for container width sizing

string | undefined
unknown
collapsible collapsible

Whether the drawer can be collapsed (shows toggle button)

boolean
false
accessible-label-collapsed accessibleLabelCollapsed

The accessible label for the collapsed state

string
'Expand navigation'
accessible-label-expanded accessibleLabelExpanded

The accessible label for the expanded state

string
'Collapse navigation'
expand-at expandAt

Breakpoint at which the element switches from mobile disclosure pattern to a drawer Available breakpoints: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'

'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
'md'
menu-label menuLabel

The label for the menu

string
'Menu'
Methods 1
Method Name Description
toggle()
Events 1
Event Name Description
toggle
CSS Shadow Parts 0
None
CSS Custom Properties 1
CSS Property Description Default
--rh-z-index-navigation-drawer

The z-index of the navigation drawer, defaults to 102

Design Tokens 12
Token Copy
--rh-border-radius-pill
Full CSS Variable Permalink to this token
--rh-border-width-md
Full CSS Variable Permalink to this token
--rh-border-width-sm
Full CSS Variable Permalink to this token
--rh-color-border-interactive
Full CSS Variable Permalink to this token
--rh-color-border-subtle
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-default
Full CSS Variable Permalink to this token
--rh-color-surface
Full CSS Variable Permalink to this token
--rh-space-2xl
Full CSS Variable Permalink to this token
--rh-space-3xl
Full CSS Variable Permalink to this token
--rh-space-lg
Full CSS Variable Permalink to this token
--rh-space-md
Full CSS Variable Permalink to this token
--rh-space-xl
Full CSS Variable Permalink to this token

Other libraries

To learn more about our other libraries, visit the getting started page.

© 2021-2025 Red Hat, Inc. Deploys by Netlify