Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/magicbruno/swalstrap4
https://github.com/magicbruno/swalstrap4
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/magicbruno/swalstrap4
- Owner: magicbruno
- Created: 2022-08-04T16:01:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-27T08:08:25.000Z (about 2 years ago)
- Last Synced: 2023-08-13T23:50:29.740Z (over 1 year ago)
- Language: JavaScript
- Size: 49 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swalstrap for Bootstrap 4
A Swetalert and Bootbox alternative, built on Bootstrap 4 Modal and Toast components. Are you using Bootstrap 5? [Go here](https://github.com/magicbruno/SwalStrap5).## Getting started
Load Swalstrap form CDN:```
```
swalstrap_all.js will load automatically Swalstrap stylesheet and will create a default instance of Swalstrap class named Swal (and also aliased as swal, Sweetalert and sweetalert).You can use Swalstrap applying fire method to the created instance:
```Swal.fire('Wanderful!','Swalstrap is working!','success')
```
If you prefer you can load Swalstrap stylesheet (or a customized one) separately:
``````
and load swalstrap.js version:
``````
In this case you must create at least an instance of Swalstrap an then use it to open your popups:
```// Create an instance
const mySwal = new Swalstrap();
// Then use it for all your popups
mySwal.fire('Wanderful!','Swalstrap is working!','success');```
## DownloadingAlternatively you can install package via npm:
```
npm install @magicbruno/[email protected]
```
clone the git repository:
```
git clone https://github.com/magicbruno/SwalStrap4.git
```
or [download it](https://github.com/magicbruno/SwalStrap4/archive/refs/heads/main.zip).>### Warning
>Swalstrap is inspired to Sweetalert NOT a clone. Features are reproduced not copied.
>So there are differences. Please, watch documentation and test examples.- [Documentation](https://magicbruno.github.io/SwalStrap4/api.html).
- [Examples](https://magicbruno.github.io/SwalStrap4/basic-examples.html).
- [Customization example](https://magicbruno.github.io/SwalStrap4/custumization.html).