This documentation is rather dry, not particularly well organised and incomplete. If you want to help out then please fork & edit this page!
A simple alert dialog with a single button. Pressing escape dismisses the dialog. If a callback is provided it is not passed any value when executed.
Usage | Result |
---|---|
bootbox.alert(str message) | Dialog with default 'OK' button |
bootbox.alert(str message, fn callback) | Default button text, callback invoked on dismissal |
bootbox.alert(str message, str label) | Custom button text |
bootbox.alert(str message, str label, fn callback) | Custom button text, callback invoked on dismissal |
A confirm dialog with a cancel and a confirm button. Pressing escape dismisses the dialog and invokes the callback as if the user had clicked the cancel button. If a callback is provided it is passed a value of true or false depending on which button the user pressed.
Usage | Result |
---|---|
bootbox.confirm(str message) | Dialog with default 'Cancel' and 'OK' buttons |
bootbox.confirm(str message, fn callback) | Default buttons, callback invoked on dismissal |
bootbox.confirm(str message, str cancel) | Custom cancel button text, standard confirm button |
bootbox.confirm(str message, str cancel, fn callback) | Custom cancel button text, callback invoked on dismissal |
bootbox.confirm(str message, str cancel, str confirm) | Custom cancel and confirm buttons |
bootbox.confirm(str message, str cancel, str confirm, fn callback) | Custom cancel and confirm buttons, callback invoked on dismissal |
A dialog which prompts for user input. Pressing escape dismisses the dialog and invokes the callback as if the user had clicked the cancel button. If a callback is provided it is passed a value of null if the user cancels or dismissed the dialog, otherwise it is passed the value of the text input.
Usage | Result |
---|---|
bootbox.prompt(str message) | Prompt with default 'Cancel' and 'OK' buttons |
bootbox.prompt(str message, fn callback) | Default buttons, callback invoked on dismissal |
bootbox.prompt(str message, str cancel) | Custom cancel button text, standard confirm button |
bootbox.prompt(str message, str cancel, fn callback) | Custom cancel button text, callback invoked on dismissal |
bootbox.prompt(str message, str cancel, str confirm) | Custom cancel and confirm buttons |
bootbox.prompt(str message, str cancel, str confirm, fn callback) | Custom cancel and confirm buttons, callback invoked on dismissal |
bootbox.prompt(str message, str cancel, str confirm, fn callback, str defaultValue) | Custom cancel and confirm buttons, default prompt value, callback invoked on dismissal |
A completely customisable dialog method. As many buttons and callbacks as you like.
Usage | Result |
---|---|
bootbox.dialog(str message) | Dialog with no buttons |
bootbox.dialog(str message, object handler) | Needs docs |
bootbox.dialog(str message, array handlers) | Needs docs |
bootbox.dialog(str message, array handlers, object options) | Needs docs |
Hide all currently active bootbox dialogs. Individual dialogs can be closed as per normal Bootstrap dialogs: dialog.modal('hide').
Indicate whether dialogs should animate in and out.
Set the dialog backdrop value—values as per Bootstrap's modals.
Any custom classes to add to the dialog.
Establish which icons to show for default OK, Cancel and Confirm buttons.
Set the language for the default OK, Cancel and Confirm buttons. Values: en, fr, de, es, br, nl, ru, it.
Add a custom locale.
This documentation is rather dry, not particularly well organised and incomplete. If you want to help out then please fork & edit this page!