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

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

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

Modified panel border

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

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

Documentation

Accessibility

AttributeApplied toOutcome
aria-expanded="true".pf-c-drawer__panelIndicates that the expandable content is visible. Required
aria-expanded="false".pf-c-drawer__panelIndicates 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-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-border.pf-c-drawer__panelModifies the drawer panel border treatment to disable box-shadow and enable solid border.
.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__content--MarginRightc_drawer__content_MarginRight
calc(var(--pf-c-drawer__panel--Width) * -1)
--pf-c-drawer__content--Transitionc_drawer__content_Transition
margin-right .25s ease
--pf-c-drawer__content--ZIndexc_drawer__content_ZIndex
var(--pf-global--ZIndex--xs)
--pf-c-drawer__panel--BackgroundColorc_drawer__panel_BackgroundColor
var(--pf-global--BackgroundColor--light-100)
--pf-c-drawer__panel-body--md--PaddingBottomc_drawer__panel_body_md_PaddingBottom
var(--pf-global--spacer--lg)
--pf-c-drawer__panel-body--md--PaddingLeftc_drawer__panel_body_md_PaddingLeft
var(--pf-global--spacer--lg)
--pf-c-drawer__panel-body--md--PaddingRightc_drawer__panel_body_md_PaddingRight
var(--pf-global--spacer--lg)
--pf-c-drawer__panel-body--md--PaddingTopc_drawer__panel_body_md_PaddingTop
var(--pf-global--spacer--lg)
--pf-c-drawer__panel-body--PaddingBottomc_drawer__panel_body_PaddingBottom
var(--pf-global--spacer--md)
--pf-c-drawer__panel-body--PaddingLeftc_drawer__panel_body_PaddingLeft
var(--pf-global--spacer--md)
--pf-c-drawer__panel-body--PaddingRightc_drawer__panel_body_PaddingRight
var(--pf-global--spacer--md)
--pf-c-drawer__panel-body--PaddingTopc_drawer__panel_body_PaddingTop
var(--pf-global--spacer--md)
--pf-c-drawer__panel--md--Widthc_drawer__panel_md_Width
28.125rem
--pf-c-drawer__panel--Transformc_drawer__panel_Transform
translateX(0)
--pf-c-drawer__panel--Transitionc_drawer__panel_Transition
transform .25s ease
--pf-c-drawer__panel--Widthc_drawer__panel_Width
100%
--pf-c-drawer__panel--ZIndexc_drawer__panel_ZIndex
var(--pf-global--ZIndex--sm)
--pf-c-drawer--m-expanded__panel--BoxShadowc_drawer_m_expanded__panel_BoxShadow
var(--pf-global--BoxShadow--md-left)
--pf-c-drawer--m-expanded__panel--Transformc_drawer_m_expanded__panel_Transform
translateX(0)
--pf-c-drawer--m-expanded--m-inline__content--MarginRightc_drawer_m_expanded_m_inline__content_MarginRight
0