Dialog

June 1, 2019 ยท View on GitHub

Displays a single dialog, or a stack of dialogs.

Main features

  • Set as dismissable or as modal dialog
  • Set backdrop background
  • Set full screen
  • Set z-index
  • Custom transitions
  • Create multiple stacked dialogs
  • Spawn dialogs from different locations
  • RTL (right-to-left) support

Usage

Options

A dialog is invoked with Dialog.show(dialogOptions), where dialogOptions are Dialog Pane options, optionally combined with dialog specific options.

Dialog specific options

ParameterRequiredTypeDefaultDescription
backdropoptionalBooleanfalseSet to true to show a backdrop background color
fullScreenoptionalBooleanfalseSet to true to make the dialog full screen; title and footer will be ignored; pass a Toolbar to body (see "Usage" for an example)
modaloptionalBooleanfalseSet to true to create a modal dialog; tapping the backdrop will not close the dialog
disableEscapeoptionalBooleanfalseSet to true to not close the dialog when pressing ESCAPE
panesoptionalArray of DialogPane components (React)Used internally
panesOptionsoptionalArray of DialogPane component options (Mithril)Used internally
shadowDepthoptionalNumber 0-53Depth of the shadow

Dialog pane options

See: Dialog Pane

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

Dialog is composed from:

CSS classes