https://github.com/bgaze/bootstrap4-dialogs
A tiny and flexible collection of dialogs based on Bootstrap 4 modals
https://github.com/bgaze/bootstrap4-dialogs
alert bootstrap4 confirm dialogs prompt
Last synced: 2 months ago
JSON representation
A tiny and flexible collection of dialogs based on Bootstrap 4 modals
- Host: GitHub
- URL: https://github.com/bgaze/bootstrap4-dialogs
- Owner: bgaze
- License: mit
- Created: 2019-03-15T12:26:42.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T03:34:41.000Z (about 5 years ago)
- Last Synced: 2025-04-03T22:03:22.322Z (2 months ago)
- Topics: alert, bootstrap4, confirm, dialogs, prompt
- Language: HTML
- Homepage: https://packages.bgaze.fr/bootstrap4-dialogs
- Size: 132 KB
- Stars: 8
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bootstrap 4 dialogs
[](https://github.com/bgaze/bootstrap4-dialogs/blob/master/LICENSE)

[](https://github.com/bgaze/bootstrap4-dialogs/releases)
[](https://github.com/bgaze/bootstrap4-dialogs/stargazers)
[](https://www.npmjs.com/package/bgaze-bootstrap4-dialogs)
BSD is a tiny and flexible collection of dialog popups based on Bootstrap 4 modals.
Custom dialogs can be easily defined, in addition to built-in ones (alert, confirm and prompt).## Documentation
Full documentation and examples are available at [https://packages.bgaze.fr/bootstrap4-dialogs](https://packages.bgaze.fr/bootstrap4-dialogs)
## Quick start
BSD requires jQuery v1.9+ and Bootstrap 4 modal component.
Several quick start options are available:
* Install with npm: `npm i bgaze-bootstrap4-dialogs`
* Install with yarn: `yarn add bgaze-bootstrap4-dialogs`
* Install via CDN: `https://cdn.jsdelivr.net/gh/bgaze/bootstrap4-dialogs@2/dist/bootstrap4-dialogs.min.js`
* Install with Composer: `composer require bgaze/bootstrap4-dialogs`
* Download the latest release: [https://github.com/bgaze/bootstrap4-dialogs/releases](https://github.com/bgaze/bootstrap4-dialogs/releases)
* Clone the repo: `git clone https://github.com/bgaze/bootstrap4-dialogs.git`Just make sure to include required dependencies into your app, then include the library:
* If installed as a module, import it: `const bsd = require("bgaze-bootstrap4-dialogs");`
* Otherwise include the script into your page: ``That's it! Now you can use the globally declared `bsd` object.
```javascript
// Alert
bsd.alert('Lorem ipsum dolor sit amet');// Confirm
bsd.confirm('Lorem ipsum dolor sit amet', function (confirmed) {
if (confirmed) {
// ...
}
});// Prompt
bsd.prompt('Lorem ipsum dolor sit amet', function (value) {
if (value !== null) {
if (value.trim() === '') {
// Prevent dialog closing, as provided value is empty.
return false;
}console.log(value);
}
});
```