Skip to content

u1ui/dialog.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 

Repository files navigation

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/dialog.js@x.x.x/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. ♥