alert, prompt, confirm but async
- alert(), prompt() and confirm() are API-compatible but async.
- Uses native Dialog-Element (polyfill here: https://github.com/nuxodin/dialog-polyfill)
- Unstyled, style it yourself!
- Lightweight
<button onclick="module.alert('Just a test').then(console.log)">run</button>
:where(.\:modal, :modal) {
box-shadow: 0 0 1rem #0008;
border: 0;
border-radius: .3rem;
}
import * as module from "https://cdn.jsdelivr.net/gh/u1ui/dialog.js@x.x.x/dialog.min.js"
To get sure your lib works even if the script does not load, you can fallback to the native confirm/alert/prompt function.
const {confirm} = await import('../fails/dialog.js').catch(e=>window);
await confirm('test');
- MIT License, Copyright (c) 2022 (like all repositories in this organization)
- Suggestions, ideas, finding bugs and making pull requests make us very happy. ♥