Dojo NG is being built in the open, one section at a time — follow along on Heptapod.

API REFERENCE · OVERLAYS

<dj-dialog>

A modal dialog. Slots: title, default (content), actions. Locks body scroll while open, closes on Escape and the close button, and on underlay click unless modal. role="alertdialog" is always modal. Restores focus to the previously focused element on close. Emits dj-close. Parts: underlay, dialog, title, close, content, actions.

Try it in the playground

@dojo-ng/dialog · v0.1.2

npm install @dojo-ng/dialog

import "@dojo-ng/dialog";

Properties

PropertyAttributeTypeDefault
open open reflected boolean false
closeable closeable boolean true
modal modal boolean false
underlay underlay boolean true
role role reflected "dialog""alertdialog" "dialog"
closeText close-text string None

Events

dj-close

Slots

SlotDescription
title
Default slotcontent
actions

CSS parts

Style these with dj-dialog::part(name).

underlaydialogtitleclosecontentactions

CSS custom properties

PropertyDefaultDescription
--dj-dialog-z-index941Stacking order of the dialog.
--dj-dialog-underlay-z-index940Stacking order of the dialog underlay (scrim).

Methods

close()