<details-dialog> element
A modal dialog that's opened with a <details> button.
Installation
$ npm install --save details-dialog-element
Usage
Open dialog Modal content Close
Deferred loading
Dialog content can be loaded from a server by embedding an <include-fragment>
element.
Robots Loading…
The src
attribute value is copied to the <include-fragment>
the first time the <details>
button is toggled open, which starts the server fetch.
If the preload
attribute is present, hovering over the <details>
element will trigger the server fetch.
Events
details-dialog-close
details-dialog-close
event is fired from <details-dialog>
when a request to close the dialog is made from
- pressing escape,
- clicking on
summary, [data-close-dialog]
, or dialog.toggle(false)
This event bubbles, and can be canceled to keep the dialog open.
document
Browser support
Browsers without native custom element support require a polyfill.
- Chrome
- Firefox
- Safari
- Microsoft Edge
Development
npm install
npm test
License
Distributed under the MIT license. See LICENSE for details.