Try Install Learn Blog API Packages GitHub
Pages
mint-ui

Search
Basic information
Entities
Versions
Dependencies
mint-color 0.9.0 <= v < 1.0.0

Ui.Drawer

A global drawer component.

Some of its features:

  • When open pressing Esc closes it.
  • After opening it will focus the first focusable item.
  • Showing it returns a promise which is resolved when its closed or rejected when cancelled.
  • The keyboard focus is trapped in the list: Tab and Shift-Tab cycles focusable elements.
  • When closed the focus is returned to the last focused element before opening (which is usually the one that opened the drawer).

States

content
:
Html
=
<></>

The content of the drawer.

focusedElement
:
Maybe(Dom.Element)
=
Maybe::Nothing

The previously focused element.

minWidth
:
String
=
"0"

The minimum width of the drawer.

open
:
Bool
=
false

Whether or not the drawer is open.

resolve
:
Function(Maybe(Void), Void)
=
(value : Maybe(Void)) { void }

The resolve function.

transitionDuration
:
Number
=
240

The transition duration.

zIndex
:
Number
=
900

The z-index of the drawer.

Functions

cancel
:
Promise(Void)

Cancels the drawer.

hide
:
Promise(Void)

Hides the drawer.

render
:
Html

Renders the drawer.

show
(
content
:
Html
)
:
Promise(Void)

Shows the component with the given content.

showWithOptions
(
content
:
Html
zIndex
:
Number
transitionDuration
:
Number
minWidth
:
String
openCallback
:
Function(Promise(Void))
)
:
Promise(Void)

Shows the component with the given content and z-index.