This documentation is rather dry, not particularly well organised and incomplete. If you want to help out then please fork & edit this page!

bootbox.alert(…)

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

bootbox.confirm(…)

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

bootbox.prompt(…)

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

bootbox.dialog(…)

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

bootbox.hideAll()

Hide all currently active bootbox dialogs. Individual dialogs can be closed as per normal Bootstrap dialogs: dialog.modal('hide').

bootbox.animate(boolean)

Indicate whether dialogs should animate in and out.

bootbox.backdrop(string)

Set the dialog backdrop value—values as per Bootstrap's modals.

bootbox.classes(string)

Any custom classes to add to the dialog.

bootbox.setIcons(object)

Establish which icons to show for default OK, Cancel and Confirm buttons.

bootbox.setLocale(string)

Set the language for the default OK, Cancel and Confirm buttons. Values: en, fr, de, es, br, nl, ru, it.

bootbox.addLocale(object)

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!

© 2011-2012 Nick Payne. I run a small company—why not see if you want to work with us?