Drawer

December 31, 2018 ยท View on GitHub

Navigation panel that appears with a cover or push animation, or can be placed permanently.

Main features

  • Choose between standard (permanent or dismissible) or cover drawer
  • Choose animation: covering, pushing, or create a custom transition
  • Optional mini behavior (expanding from an icon-only view)
  • Optionally add a backdrop, shadow or border
  • Optionally place at the right side
  • RTL (right-to-left) support

Usage

Options

Drawer specific options

ParameterRequiredTypeDefaultDescription
anchoroptionalString"start"Set to "end" to reveal the drawer from the far (right) side; with RTL "end" becomes the left side
backdropoptionalBooleanfalseSet to true to show a backdrop background color
borderoptionalBooleanfalseUseful with a permanent or pushing drawer when no shadow is used; set to true to create a border at the right side; with RTL the border is shown at the left side
fixedoptionalBooleanfalseSet to true to give the drawer CSS property position: fixed; useful for an app drawer (that must be shown covering all content) when it is drawn from a deeper component
floatingoptionalBooleanfalseVariant of permanent; additionally set this to true to display the drawer as a "floating" block (instead of full height)
minioptionalBooleanfalseSet to true to display a fraction of the drawer (typically to show the icons only), and to reveal the full menu when expanding
modaloptionalBooleanfalseSet to true to create a modal drawer; tapping the backdrop or pressing ESCAPE will not close the drawer
permanentoptionalBooleanfalseSet to true to display the drawer as a permanent side menu
pushoptionalBooleanfalse (cover)Set to true to animate the drawer with a push animation, pushing away the content next to the drawer
shadowDepthoptionalNumber 0-50Depth of the shadow; 0 will show no shadow
showoptionalBooleanfalseSet to true to reveal the drawer, false to hide a displayed drawer

Transition options

See: Transitions

Common component options

ParameterRequiredTypeDefaultDescription
afteroptionalString, hyperscript or componentExtra content after main content; note that this content is placed right of preceding elements with a higher stacking depth
beforeoptionalString, hyperscript or componentExtra content before main content; note that this content is placed left of subsequent elements with a lower stacking depth
classNameoptionalStringExtra CSS class appended to pe-drawer
contentoptionalString, hyperscript or componentAlternative content; replaces body
elementoptionalString"form"HTML element tag
idoptionalStringHTML element id
styleoptionalObjectFor setting simple style attributes; will be applied to pe-dialog__content
toneoptionalString: "dark" or "light"Renders the component light on dark (sets class pe-dark-tone); use "light" to locally inverse (sets class pe-light-tone)

Composition

Drawer is composed from:

CSS classes