A modern, vanilla JavaScript replacement for Bootbox using Bootstrap 5.3+ modals. No jQuery required!
Simple alert messages with customizable content and callbacks.
Yes/No confirmation dialogs with boolean result callbacks.
User input dialogs with various input types and validation.
Dropdown selects, checkboxes, and radio buttons.
Date pickers, time inputs, numbers, and ranges.
Custom styling with Bootstrap classes and themes.
Multiple buttons, sizes, and positioning options.
// Basic Alert
yobox.alert('Hello World!');
// Confirm Dialog
yobox.confirm('Are you sure?', function(result) {
if (result) {
console.log('User confirmed');
}
});
// Prompt Dialog
yobox.prompt('What is your name?', function(name) {
if (name) {
console.log('Hello ' + name);
}
});
yobox.dialog({
title: 'Custom Dialog',
message: '<p>Custom HTML content</p>',
size: 'large',
buttons: {
cancel: {
label: 'Cancel',
className: 'btn-danger',
callback: function() {
console.log('Cancelled');
}
},
ok: {
label: 'OK',
className: 'btn-success',
callback: function() {
console.log('OK clicked');
}
}
}
});