tmbox
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Powered by Tanuel Documentation Build Pipeline npm npm

TmBox

➡ Project Page ⬅

➡ Full API Reference (TypeDoc) ⬅

Install

Using yarn

yarn add tmbox

using npm

npm install tmbox

Usage

More examples here

 
/**
 * Alert Box
 */
const alertBox = new TmBoxAlert({
    title: "TmBoxAlert",
    message: "This is an Alert Box",
    onConfirm: () => {
        alert('Accepted -> calling onConfirm callback');
    }
});
alertBox.open();
 
/**
 * Confirm Box
 */
const confirmBox = new TmBoxConfirm({
    title: "TmBoxConfirm",
    message: "This is a Confirm Box",
    onConfirm: () => {
        alert('Accepted -> calling onConfirm callback');
    },
    onCancel: () => {
        alert('Canceled -> calling onCancel callback')
    }
});
confirmBox.open();
 
/**
 * Prompt Box
 */
const promptBox = new TmBoxPrompt({
    title: "TmBoxPrompt",
    message: "This is a Prompt Box",
    inputPlaceholder: "Put something here",
    onConfirm: value => {
        alert('Accepted -> passing result to onConfirm callback: ' + value);
    },
    onCancel: () => {
        alert('Canceled -> no result');
    }
});
promptBox.open();

Package Sidebar

Install

npm i tmbox

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

88.3 kB

Total Files

47

Last publish

Collaborators

  • tanuel