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

Drawer

OverviewStyleGuidelinesCodeAccessibilityDemos
ImportingUsagerh-drawerImportingUsagerh-drawer

Importing

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

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

<rh-drawer open>
  <div slot="header">Header</div>
  <div slot="body">Body</div>
  <div slot="footer">Footer</div>
  <div>
    <h3>Main Content</h3>
    <p>The default auto variant displays as inline at wide container widths and switches to
      overlay below 992px.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
      ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
      laboris nisi ut aliquip ex ea commodo consequat.</p>
  </div>
</rh-drawer>

<script type="module">
  import '@rhds/elements/rh-drawer/rh-drawer.js';
</script>
Copy to Clipboard Wrap lines

rh-drawer

A drawer is a panel that slides in from the edge of its container, providing supplementary content or navigation without leaving the current page.

Slots 10

Slot Name Summary Description
fullscreen-label-expand

Accessible label for the fullscreen button when not fullscreen

fullscreen-label-collapse

Accessible label for the fullscreen button when fullscreen

close-label

Accessible label for the close button

header

Header content for the panel

body

Body content for the panel

footer

Footer content for the panel

resize-label

Accessible label for the resize handle

collapse-label-open

Accessible label for the collapse toggle when panel is open

collapse-label-closed

Accessible label for the collapse toggle when panel is closed

[default]

Page content displayed alongside the panel (not used with fixed variant)
Note: [default] unnamed slots do not have a slot="name" attribute.

Attributes 7

Attribute DOM Property Description Type Default
variant variant

Controls the layout behavior of the drawer.

'auto' | 'fixed' | 'flow' | 'overlay' | 'inline'
'auto'
position position

Which side the panel appears on.

'inline-start' | 'inline-end'
'inline-start'
open open

Whether the drawer panel is open.

boolean
false
trigger-id triggerId

Optional ID of the external trigger element.

string
unknown
fullscreen fullscreen

Adds a fullscreen toggle button to the panel actions.

boolean
false
panel panel

Controls the panel edge interaction.

  • collapsible: adds a collapse/expand toggle button (default for overlay/inline)
  • resizable: adds a drag bar for manual resizing Overlay and inline variants default to collapsible when not set. Fixed variant ignores collapsible.
'collapsible' | 'resizable' | 'none'
unknown
storage-key storageKey

When set, persists open/closed state and panel width to sessionStorage under this key.

string
unknown

Methods 3

Method Name Description
show()

Opens the drawer panel.

close()

Closes the drawer panel.

toggle()

Toggles the drawer panel open/closed.

Events 2

Event Name Description
open

Fires when the drawer panel opens.

close

Fires when the drawer panel closes.

CSS Shadow Parts 9

Part Name Summary Description
panel
fullscreen-button
close-button
header
body
footer
resize-handle
collapse-toggle
content

CSS Custom Properties 1

CSS Property Description Default
--rh-drawer-content-padding var(--rh-space-4xl, 64px)

Design Tokens 25

Token Description Copy
--rh-color-surface
Full CSS Variable Permalink to this token
--rh-font-family-body-text

Body text font family

Full CSS Variable Permalink to this token
--rh-color-text-primary
Full CSS Variable Permalink to this token
--rh-space-sm

6px spacer

Full CSS Variable Permalink to this token
--rh-space-md

8px spacer

Full CSS Variable Permalink to this token
--rh-border-radius-default

3px border radius; Example: Card

Full CSS Variable Permalink to this token
--rh-color-text-secondary
Full CSS Variable Permalink to this token
--rh-color-text-secondary-on-dark

Secondary text color for dark theme

Full CSS Variable Permalink to this token
--rh-color-text-secondary-on-light

Secondary text color for light theme

Full CSS Variable Permalink to this token
--rh-color-interactive-secondary-active
Full CSS Variable Permalink to this token
--rh-font-family-heading

Heading font family

Full CSS Variable Permalink to this token
--rh-font-size-heading-sm

h5 heading font size

Full CSS Variable Permalink to this token
--rh-font-weight-body-text-regular

Regular font weight

Full CSS Variable Permalink to this token
--rh-space-xl

24px spacer

Full CSS Variable Permalink to this token
--rh-box-shadow-sm

Small box shadow

Full CSS Variable Permalink to this token
--rh-color-surface-light

Secondary surface (light theme)

Full CSS Variable Permalink to this token
--rh-color-surface-dark

Tertiary surface (dark theme)

Full CSS Variable Permalink to this token
--rh-color-icon-secondary
Full CSS Variable Permalink to this token
--rh-border-width-md

2px border width: Example: Alert

Full CSS Variable Permalink to this token
--rh-color-interactive-primary-default
Full CSS Variable Permalink to this token
--rh-border-width-sm

1px border width; Example: Secondary CTA or Button

Full CSS Variable Permalink to this token
--rh-color-border-subtle
Full CSS Variable Permalink to this token
--rh-space-lg

16px spacer

Full CSS Variable Permalink to this token
--rh-space-2xl

32px spacer

Full CSS Variable Permalink to this token
--rh-space-4xl

64px spacer

Full CSS Variable Permalink to this token
© 2026 Red Hat Deploys by Netlify