Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

yesno-dialog

SidKH13kMIT0.2.1

Javascript yes no dialog

js, javascript, vanilla, yesno, dialog

readme

Javascript yes no dialog

Build status License

Tiny customizable vanilla js confirm dialog

Install

npm install --save yesno-dialog

Usage

import yesno from "yesno-dialog";

showCatButton.addEventListener('click', async () => {
  const yes = await yesno()
  if (yes) // show the cat
})

Js yes no dialog example

Customization

import yesno from "yesno-dialog";

showCatButton.addEventListener('click', async () => {
  const yes = await yesno({
    labelYes: "Yep",
    labelNo: "Nope",
    bodyText: "Sure?"
  })
  if (yes) // show the cat
})
.jsyesnodialog {
  --color: #e91e63;
}

Js yes no dialog customize

Codesandbox examples

License

MIT © SidKH