Install

To install this library, you can use npm for package management, the CDN for direct inclusion, or manually download it from the GitHub releases page.

  1. Install use-bootstrap-dialog in your Node.js powered apps with the npm package:

    npm install use-bootstrap-dialog
  2. After installation, you can import the library into your project as follows:

    import 'use-bootstrap-dialog/dist/css/use-bootstrap-dialog.css'
    import UseBootstrapDialog from 'use-bootstrap-dialog'

You can use use-bootstrap-dialog directly via CDN:

<link href="https://cdn.jsdelivr.net/npm/use-bootstrap-dialog@1.0.0/dist/css/use-bootstrap-dialog.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/use-bootstrap-dialog@1.0.0/dist/js/use-bootstrap-dialog.min.js"></script>

Example

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/use-bootstrap-dialog@1.0.0/dist/css/use-bootstrap-dialog.min.css" rel="stylesheet">
    <title>Example</title>
  </head>
  <body>
    <button type="button" class="btn btn-primary" id="hello">Hello</div>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/use-bootstrap-dialog@1.0.0/dist/js/use-bootstrap-dialog.min.js"></script>
    <script>
      document.getElementById('hello').addEventListener('click', () => {
        UseBootstrapDialog.alert('Hello world!')
      })
    </script>
  </body>
</html>

Visit the GitHub releases page to download the latest version