tmbox
v1.0.4
Published
Library for alerts, prompts, etc.
Downloads
1
Maintainers
Readme
TmBox
➡ Full API Reference (TypeDoc) ⬅
Install
Using yarn
yarn add tmbox
using npm
npm install tmbox
Usage
/**
* 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();