Drawer
Search the component library

Drawer

v2.1.0

A drawer is a convenient way to present information such as notifications or context-sensitive help. Use a drawer for secondary content which only needs to appear when specifically requested by users.



Show/Hide

When users click a UI element in the header, such as the Notifications or Help icon, this triggers a drawer to slide in from the right. Users can dismiss the drawer by:

  • Clicking an X close button.
  • Clicking the trigger element again. 
  • Pressing the Esc key.

Standard view

A standard drawer has a section for a title at the top and includes a Close "x button.

Content can populate the area below this with 30px margins. Custom background colors and dividing lines can extend to 100% width.

Standard view

Detailed view

A standard drawer changes to a detailed view when a user selects a topic in the Help list. This view includes a Back label and icon so the user can return to the standard view.

When the user closes the drawer, it should retain its state. Then when the user reopens the drawer, it should still display in detailed view.

Detailed view

Animation

Displaying the second level uses an animation to provide context.

Responsive behavior

A drawer maintains the same behavior all the way down to the extra small breakpoint, at which point it begins taking up 100% of the viewport width.

Redlines

Standard view

Spacing30px side, 25px top and 30px bottom margins around the content area
20px vertical margins below the title area, 30px side margins, 25px top margin
20px side margins around title separator
Drawer is 320px wide at the Small breakpoint and wider
Drawer is 100% width at the Extra Small breakpoint
Dividing lines may extend past the content area, up to 100% width
BackgroundDefault background is white, may customized to an accessible color and extend to 100% width.
Border is 1px solid alto (#D9D9D9)
TypographyTitle is a Basic section heading
IconsClose icon is Remove-sm-24
A focused icon will use the standard browser outline for focus
Touch target: 44 x 44px
Shadowbox-shadow of 5px blur, rgba(199,199,199,0.70) color
Title separator1px solid alto
Keyboard shortcutsPressing escape should close the drawer in any mode
Focus behaviorOpening the drawer moves focus from the triggering element to the first focusable item within the drawer (typically the Close icon).
Tabbing within the drawer should cycle through focusable items like normal
The drawer should capture focus, so you won't be able to tab out of the drawer
Upon dismissing the drawer focus should be restored to the triggering element
ScrollingContent should scroll under the drawer header, which remains stickied to the top of the drawer
A subtle shadow effect appears once content is scrolled beneath the header

Detailed view

TitleUse a static "Back" label
Focusing the "< Back" element will use the standard browser outline for focus
Uses Bold UI Text in Charcoal
SpacingGenerally the same spacing as the Standard view
28px above the title and 25px below the title (should keep the close icon in the same place)
IconChevron-back-18 icon
10px spacing between icon and label
Focus behaviorFollow the patterns of the Standard drawer
Transitioning into the Detailed view should move focus to the first focusable element of the view (typically the back button)
Focus should again be captured
Focus targets from the Standard view should not be accessible

Show/Hide transition

AnimationSlide in from the right
Timing0.5 seconds
ease-in-out easing

Detailed view transition

AnimationContent container slides in from the right
Title slides away to the left
Back fades/slides in from about the middle of the drawer
Content0.3 seconds
ease-in-out
Opacity is 0 in hidden state
Hiding titleMove 40px off to the left
Opacity fades to 0
0.3 seconds
ease-in-out
Restoring titleRestore properties
0.4 seconds
ease-in-out
Showing backStarts with midpoint centered at 60% of the content width and opacity of 0
0.3 seconds
ease-in-out
Hiding backReset position and opacity
0.4 seconds
ease-in-out

Changelog

2.1.0

Parker Malenke

  • CHANGED: Drawer header to remain sticky when scrolling drawer contents

2.0.3

  • ADDED: Specification for touch target sizes around the BACK arrow and text

2.0.2

  • ADDED: Specification for touch target sizes

2.0.1

  • ADDED: Feature links
  • FIXED: Spacing redlines around the title in both views

2.0.0

Apply new brand to existing component.

1.0.0

Initial version.