Skip to content

cfware/dialog

Repository files navigation

@cfware/dialog NPM Version

Dialog overlays

Usage

import {html} from '@cfware/shadow-element';
import {dialogAlert, dialogConfirm} '@cfware/dialog';

async function showAlert() {
	await dialogAlert('Title', html`<div>html tagged template</div>`);
	console.log('dialog closed');
}

async function showConfirm() {
	const result = await dialogConfirm('Continue', html`<div>Decide</div>`);
	console.log(result ? 'confirmed' : 'canceled');
}