Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.21 KB

README.md

File metadata and controls

51 lines (35 loc) · 1.21 KB

dialog.js

alert, prompt, confirm but async

Features

Usage

<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;
}

doc

Install

import * as module from "https://cdn.jsdelivr.net/gh/u1ui/[email protected]/dialog.min.js"

Demos

minimal.html
test.html

Pro-Tip

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');

About

  • MIT License, Copyright (c) 2022 (like all repositories in this organization)
  • Suggestions, ideas, finding bugs and making pull requests make us very happy. ♥