Library / SDK
bootboxjs/bootbox avatar
bootboxjs/bootbox

Bootbox: alert(), confirm() and prompt() rebuilt as Bootstrap modals

Wrappers for JavaScript alert(), confirm() and other flexible dialogs using Twitter's bootstrap framework

5,018 stars1,023 forksJavaScriptNOASSERTION

At a glance

What is it?
Bootbox is a MIT-licensed JavaScript library that wraps the browser's alert(), confirm() and prompt() in Bootstrap-powered dialog boxes and adds more flexible dialogs on top. Its version history is a Bootstrap version matrix, 6.0.0 first supports Bootstrap 5, and 3.3.0 is the last release for Bootstrap 2.2.x.
Who is it for?
Use Bootbox when the page already carries Bootstrap and jQuery and you need programmatic alert, confirm and prompt behavior without hand-writing modal markup each time, matching the Bootbox major to the Bootstrap generation, 6.x for Bootstrap 5, 5.x for Bootstrap 4, 4.x for Bootstrap 3, and 3.3.0 as the ceiling for Bootstrap 2.2.x. Skip it on stacks without those frameworks, since all three peer dependencies must be present for the wrappers to work.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Three native dialogs, redrawn as Bootstrap modals

Bootbox is a small JavaScript library of wrappers that turn the browser's native alert(), confirm() and prompt() functions into dialog boxes built on the Bootstrap framework, plus a set of more flexible dialogs for cases the native trio cannot express. The package description in package.json names exactly that scope, wrappers for alert(), confirm(), prompt() and other flexible dialogs using Bootstrap. The project lives at bootboxjs.com, the original writeup about the project is still online at paynedigital.com/bootbox, and the copyright line runs from 2011 to 2025 under the name Nick Payne, one author carrying the library across fourteen years. Bootbox does not replace Bootstrap's modal machinery, it builds on it, which is why every major version decision in its history is really a Bootstrap version decision.

The Bootstrap matrix: 6.0.0 for Bootstrap 5, 3.3.0 the end of the 2.x line

The dependency note in the README is a four-line matrix worth memorizing before any upgrade. Bootbox 6.0.0 is the first release to support Bootstrap 5.0.0. Bootbox 5.0.0 is the first release to support Bootstrap 4.0.0. Bootbox 4.0.0 is the first release to support Bootstrap 3.0.0. And Bootbox 3.3.0 is the last release to support Bootstrap 2.2.x. Picking a Bootbox version is therefore picking a Bootstrap generation, not comparing feature lists between Bootbox releases. The current 6.x line declares peerDependencies of bootstrap ^4.4.0 or ^5.0.0, so a single Bootbox major spans two Bootstrap generations at its edges. More dependency detail is maintained on the Bootbox website under the getting-started page. For anyone still on a Bootstrap 2.2.x page, 3.3.0 is the ceiling, full stop.

Three peer dependencies and a dist-only npm package

package.json declares no runtime dependencies at all. Instead it lists three peerDependencies, @popperjs/core ^2.0.0, bootstrap ^4.4.0 or ^5.0.0, and jquery ^3.5.1, meaning the host page supplies the framework and Bootbox assumes it is already there. The devDependencies tell the test story instead, bootstrap ^5.3.3 and jquery ^3.7.1 backing the current test matrix. The published package is deliberately thin, main points at dist/bootbox.js and files ships only dist/*.js, so what npm installs is just the generated bundle. The repository keeps the editable source in bootbox.js at the root, with templates/ holding dialog skeletons and locales/ collecting translated strings, none of which reaches the consumer through the npm channel.

Karma runs against dist, Grunt rebuilds it

The test suite runs on Karma with the Mocha test adapter. The workflow is npm install followed by npm test, and the project's own test script chains two configurations, karma start karma.conf.legacy.js && karma start karma.conf.js, a legacy run followed by a current one. One detail matters enormously for contributors, the tests execute against the generated files in the /dist directory, not the root source, so a change that skips the rebuild tests nothing. Running Grunt regenerates those files and runs the Karma tests in one step:

code
grunt

The contribution bar is stated bluntly, pull requests with failing tests will be rejected, with guidelines kept in CONTRIBUTING.md. The devDependencies back the suite with chai, sinon, sinon-chai and puppeteer ^23.11.1 in the toolchain.

6.0.4 touched the step option for date inputs

The latest release, v6.0.4 from 2025-05-24, is a one-line change, it updates step to allow setting value for date inputs. The two releases before it, v6.0.3 from 2025-04-13 and v6.0.2 from 2025-03-28, landed within weeks of each other that spring, and the full record lives in CHANGELOG.md at the repository root. The cadence is small and corrective rather than architectural, which fits a library whose job has been stable since Bootstrap 5 support arrived in 6.0.0. The repository itself last received a push on 2026-09-08, so work continues between release tags. Reading the changelog before upgrading remains the honest way to catch behavior tweaks between patch versions, since even a patch here can adjust how an input option applies.

bower.json and composer.json beside package.json

The repository root holds three package manifests from three eras, package.json for npm, bower.json for the front-end package manager that predates npm's dominance, and composer.json for PHP's Packagist, an unusual third channel for a JavaScript dialog library and a hint at how many server-rendered PHP pages this tool has been embedded in over the years. Beside them sit the build machinery, Gruntfile.js, header.txt and the build/ directory, and the two Karma configurations, karma.conf.js and karma.conf.legacy.js. The locales/ directory collects translated strings for dialog buttons, and templates/ holds the dialog skeletons the library renders. None of this ships to the consumer, files is dist/*.js only, the extra manifests exist so install commands keep working on legacy stacks that still expect them.

MIT text in the README, NOASSERTION on GitHub

GitHub's license detection reports NOASSERTION, while the README carries the full MIT License text with copyright 2011-2025 by Nick Payne and package.json states MIT plainly, so the licensing intent is not in doubt even though automated detection stumbles on the file layout. The README itself is short, usage instructions live on bootboxjs.com and the original writeup stays at paynedigital.com/bootbox, which makes the website, not the repository, the real documentation home. That split is worth internalizing before filing an issue, the Bootstrap dependency matrix is summarized in the README but the fuller version sits on the site's getting-started page. For a library embedded in as many legacy stacks as this one, keeping the copyright and permission notice intact in copies and substantial portions is the one condition the MIT text imposes, and the notice is present.

Editorial conclusion

Use Bootbox when the page already carries Bootstrap and jQuery and you need programmatic alert, confirm and prompt behavior without hand-writing modal markup each time, matching the Bootbox major to the Bootstrap generation, 6.x for Bootstrap 5, 5.x for Bootstrap 4, 4.x for Bootstrap 3, and 3.3.0 as the ceiling for Bootstrap 2.2.x. Skip it on stacks without those frameworks, since all three peer dependencies must be present for the wrappers to work. Contributors should rebuild the dist files with Grunt before expecting test results, because the Karma suite runs against the generated bundles, not the root source.

Frequently asked questions

What is bootbox js?

Bootbox js is a MIT-licensed JavaScript library of wrappers that turn alert(), confirm() and prompt() into Bootstrap-powered dialog boxes, plus more flexible dialogs. It has been maintained by Nick Payne since 2011, and its 6.0.0 release is the first to support Bootstrap 5.0.0.

Where can I find a bootbox confirm example?

confirm() is one of the three native functions Bootbox wraps, alongside alert() and prompt(), rendering them as Bootstrap-powered dialog boxes. Full usage instructions and examples live on bootboxjs.com rather than in the README.

Why might bootbox report it is not defined?

The npm package's main entry is dist/bootbox.js and it ships only the dist/*.js files, so the library loads from that generated bundle. It also declares peerDependencies on bootstrap, jquery and @popperjs/core, meaning the host page must supply those frameworks for Bootbox to function.

Official sources

  1. bootboxjs/bootbox on GitHub
  2. Issues
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/bootboxjs-bootbox.svg)](https://hysenlabs.com/projects/bootboxjs-bootbox)