Skip to Content
Patternfly Logo

Drawer

Info alert:Beta feature

This Beta component is currently under review, so please join in and give us your feedback on the PatternFly forum

The Drawer is a sliding panel that enters from the right edge of the viewport. It can be configured to either overlay content on a page or create a sidebar by pushing that content to the left.

ExamplesDocumentationCSS Variables

Examples

Closed panel on right (default)

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.

Expanded panel on right

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.
drawer-panel

Closed panel on left

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.

Expanded panel on left

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.
drawer-panel

Closed panel on bottom

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.

Expanded panel on bottom

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.
drawer-panel

Expanded inline panel

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.
drawer-panel

Expanded inline panel on left

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.
drawer-panel

Static

Static drawers don't have interactive elements. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.
drawer-panel

Stacked content body elements

content-body
content-body with padding
content-body
drawer-panel
drawer-panel with no padding
drawer-panel

Modified content padding

Drawer content padding. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.
drawer-panel

Modified panel padding

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.
drawer-panel

Modified panel width

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.
drawer-panel

Additional section above main

drawer-section
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium est a porttitor vehicula. Quisque vel commodo urna. Morbi mattis rutrum ante, id vehicula ex accumsan ut. Morbi viverra, eros vel porttitor facilisis, eros purus aliquet erat, nec lobortis felis elit pulvinar sem. Vivamus vulputate, risus eget commodo eleifend, eros nibh porta quam, vitae lacinia leo libero at magna. Maecenas aliquam sagittis orci, et posuere nisi ultrices sit amet. Aliquam ex odio, malesuada sed posuere quis, pellentesque at mauris. Phasellus venenatis massa ex, eget pulvinar libero auctor pretium. Aliquam erat volutpat. Duis euismod justo in quam ullamcorper, in commodo massa vulputate.
drawer-panel

Documentation

Accessibility

AttributeApplied toOutcome
aria-expanded="true"action that opens drawerIndicates that the expandable content is visible. Required
aria-expanded="false"action that opens drawerIndicates that the expandable content is hidden. Required
hidden.pf-c-drawer__panelHides the drawer panel from assistive technologies. Required

Usage

ClassApplied toOutcome
.pf-c-drawer<div>Initiates the drawer container. Required
.pf-c-drawer__section<div>Initiates a drawer section area. This element can be used above or below .pf-c-drawer__main for titles, toolbars, footers, etc.
.pf-c-drawer__main<div>Initiates the drawer main area. Required
.pf-c-drawer__content<div>Initiates the drawer content container. Required
.pf-c-drawer__panel<aside>Initiates the drawer panel container. Required
.pf-c-drawer__body<div>Initiates a drawer body container and is the child of .pf-c-drawer__content and .pf-c-drawer__panel. Required
.pf-c-drawer__head<div>Initiates a drawer head container. This container positions .pf-c-drawer__actions, if present.
.pf-c-drawer__actions<div>Identifies the drawer close button.
.pf-c-drawer__close<div>Identifies the drawer close button.
.pf-m-panel-left.pf-c-drawerModifies the drawer panel to expand from the left.
.pf-m-panel-bottom.pf-c-drawerModifies the drawer panel to expand from the bottom. Note: percentage based panel sizes require the drawer component's parent element have an implicit or explicit height.
.pf-m-expanded.pf-c-drawerModifies the drawer panel for the expanded state.
.pf-m-static{-on-[lg, xl, 2xl]}.pf-c-drawerModifies the drawer panel state to always show both content and panel.
.pf-m-inline{-on-[lg, xl, 2xl]}.pf-c-drawerModifies the drawer so the content element and panel element are displayed side by side. .pf-m-inline used without a breakpoint will default to the md breakpoint.
.pf-m-no-border.pf-c-drawer__panelModifies the drawer panel border treatment to disable all border treatment.
.pf-m-padding.pf-c-drawer__bodyModifies the element to add padding.
.pf-m-no-padding.pf-c-drawer__bodyModifies the element to remove padding.
.pf-m-no-background.pf-c-drawer__section, .pf-c-drawer__content, .pf-c-drawer__panelModifies the drawer body/panel background color to transparent.
.pf-m-width-{25, 33, 50, 66, 75, 100}{-on-[breakpoint]}.pf-c-drawer__panelModifies the drawer panel width.

CSS Variables

.pf-c-drawer--pf-c-drawer__section--BackgroundColorc_drawer__section_BackgroundColor
#fff
.pf-c-drawer--pf-c-drawer__content--FlexBasisc_drawer__content_FlexBasis
100%
.pf-c-drawer--pf-c-drawer__content--BackgroundColorc_drawer__content_BackgroundColor
#fff
.pf-c-drawer--pf-c-drawer__content--ZIndexc_drawer__content_ZIndex
100
.pf-c-drawer--pf-c-drawer__panel--FlexBasisc_drawer__panel_FlexBasis
100%
.pf-c-drawer--pf-c-drawer__panel--md--FlexBasisc_drawer__panel_md_FlexBasis
50%
.pf-c-drawer--pf-c-drawer__panel--MinWidthc_drawer__panel_MinWidth
50%
.pf-c-drawer--pf-c-drawer--m-panel-bottom__panel--md--MinHeightc_drawer_m_panel_bottom__panel_md_MinHeight
50%
.pf-c-drawer--pf-c-drawer__panel--xl--MinWidthc_drawer__panel_xl_MinWidth
28.125rem
.pf-c-drawer--pf-c-drawer__panel--xl--FlexBasisc_drawer__panel_xl_FlexBasis
28.125rem
.pf-c-drawer--pf-c-drawer--m-panel-bottom__panel--xl--MinHeightc_drawer_m_panel_bottom__panel_xl_MinHeight
18.75rem
.pf-c-drawer--pf-c-drawer--m-panel-bottom__panel--xl--FlexBasisc_drawer_m_panel_bottom__panel_xl_FlexBasis
18.75rem
.pf-c-drawer--pf-c-drawer__panel--ZIndexc_drawer__panel_ZIndex
200
.pf-c-drawer--pf-c-drawer__panel--BackgroundColorc_drawer__panel_BackgroundColor
#fff
.pf-c-drawer--pf-c-drawer__panel--TransitionDurationc_drawer__panel_TransitionDuration
250ms
.pf-c-drawer--pf-c-drawer__panel--TransitionPropertyc_drawer__panel_TransitionProperty
margin, transform, box-shadow
.pf-c-drawer--pf-c-drawer--child--PaddingTopc_drawer_child_PaddingTop
1rem
.pf-c-drawer--pf-c-drawer--child--PaddingRightc_drawer_child_PaddingRight
1rem
.pf-c-drawer--pf-c-drawer--child--PaddingBottomc_drawer_child_PaddingBottom
1rem
.pf-c-drawer--pf-c-drawer--child--PaddingLeftc_drawer_child_PaddingLeft
1rem
.pf-c-drawer--pf-c-drawer--child--md--PaddingTopc_drawer_child_md_PaddingTop
1.5rem
.pf-c-drawer--pf-c-drawer--child--md--PaddingRightc_drawer_child_md_PaddingRight
1.5rem
.pf-c-drawer--pf-c-drawer--child--md--PaddingBottomc_drawer_child_md_PaddingBottom
1.5rem
.pf-c-drawer--pf-c-drawer--child--md--PaddingLeftc_drawer_child_md_PaddingLeft
1.5rem
.pf-c-drawer--pf-c-drawer--child--m-padding--PaddingTopc_drawer_child_m_padding_PaddingTop
1rem
.pf-c-drawer--pf-c-drawer--child--m-padding--PaddingRightc_drawer_child_m_padding_PaddingRight
1rem
.pf-c-drawer--pf-c-drawer--child--m-padding--PaddingBottomc_drawer_child_m_padding_PaddingBottom
1rem
.pf-c-drawer--pf-c-drawer--child--m-padding--PaddingLeftc_drawer_child_m_padding_PaddingLeft
1rem
.pf-c-drawer--pf-c-drawer--child--m-padding--md--PaddingTopc_drawer_child_m_padding_md_PaddingTop
1.5rem
.pf-c-drawer--pf-c-drawer--child--m-padding--md--PaddingRightc_drawer_child_m_padding_md_PaddingRight
1.5rem
.pf-c-drawer--pf-c-drawer--child--m-padding--md--PaddingBottomc_drawer_child_m_padding_md_PaddingBottom
1.5rem
.pf-c-drawer--pf-c-drawer--child--m-padding--md--PaddingLeftc_drawer_child_m_padding_md_PaddingLeft
1.5rem
.pf-c-drawer--pf-c-drawer__content--child--PaddingTopc_drawer__content_child_PaddingTop
0
.pf-c-drawer--pf-c-drawer__content--child--PaddingRightc_drawer__content_child_PaddingRight
0
.pf-c-drawer--pf-c-drawer__content--child--PaddingBottomc_drawer__content_child_PaddingBottom
0
.pf-c-drawer--pf-c-drawer__content--child--PaddingLeftc_drawer__content_child_PaddingLeft
0
.pf-c-drawer--pf-c-drawer__actions--MarginTopc_drawer__actions_MarginTop
calc(pf-global--spacer--form-element * -1)
.pf-c-drawer--pf-c-drawer__actions--MarginRightc_drawer__actions_MarginRight
calc(pf-global--spacer--form-element * -1)
.pf-c-drawer--pf-c-drawer__panel--BoxShadowc_drawer__panel_BoxShadow
none
.pf-c-drawer--pf-c-drawer--m-expanded__panel--BoxShadowc_drawer_m_expanded__panel_BoxShadow
-0.75rem 0 0.75rem -0.5rem rgba(3, 3, 3, 0.18)
.pf-c-drawer--pf-c-drawer--m-expanded--m-panel-left__panel--BoxShadowc_drawer_m_expanded_m_panel_left__panel_BoxShadow
0.75rem 0 0.75rem -0.5rem rgba(3, 3, 3, 0.18)
.pf-c-drawer--pf-c-drawer--m-expanded--m-panel-bottom__panel--BoxShadowc_drawer_m_expanded_m_panel_bottom__panel_BoxShadow
0 -0.75rem 0.75rem -0.5rem rgba(3, 3, 3, 0.18)
.pf-c-drawer--pf-c-drawer__panel--after--Widthc_drawer__panel_after_Width
1px
.pf-c-drawer--pf-c-drawer--m-panel-bottom__panel--after--Heightc_drawer_m_panel_bottom__panel_after_Height
1px
.pf-c-drawer--pf-c-drawer__panel--after--BackgroundColorc_drawer__panel_after_BackgroundColor
transparent
.pf-c-drawer--pf-c-drawer--m-inline--m-expanded__panel--after--BackgroundColorc_drawer_m_inline_m_expanded__panel_after_BackgroundColor
#d2d2d2
.pf-c-drawer--pf-c-drawer--m-inline__panel--PaddingLeftc_drawer_m_inline__panel_PaddingLeft
1px
.pf-c-drawer--pf-c-drawer--m-panel-left--m-inline__panel--PaddingRightc_drawer_m_panel_left_m_inline__panel_PaddingRight
1px
.pf-c-drawer--pf-c-drawer--m-panel-bottom--m-inline__panel--PaddingTopc_drawer_m_panel_bottom_m_inline__panel_PaddingTop
1px