
Description
ngx-sweetalert2 is the official Angular integration for SweetAlert2, the popup dialog library. It is not a plain API wrapper: it adds Angular-style tools on top of SweetAlert2. You can open a popup with the swal directive for simple one-line dialogs, use the component for advanced cases and wider SweetAlert2 API coverage, or use the swalPortal directive to write popup content with Angular templates. The README includes recipes for every way to open a modal and control its visibility, for setting global defaults with mixins, and for using a theme from the SweetAlert2 themes package. The library supports standalone components for Angular 14 and later, which the README recommends, and an NgModule approach for older applications. You install ngx-sweetalert2 and sweetalert2 together, and the README asks you to upgrade SweetAlert2 whenever you upgrade this package.…
Highlights
- swal directive for simple dialogs
- Angular templates inside popups with swalPortal
- Standalone components for Angular 14 and later
- Global defaults with SweetAlert2 mixins
- Themes from the SweetAlert2 themes package
- Compatibility table for Angular and SweetAlert2 versions
Ratings & Reviews
No ratings yet
Be the first to rate ngx-sweetalert2.
People also visit

sweetalert2-react-content
Official SweetAlert2 enhancer adding support for React elements as content
ngx-sweetalert2 FAQ
What is ngx-sweetalert2?
The official Angular integration for SweetAlert2, adding Angular-style directives and components to the popup library.
How do I start?
Install ngx-sweetalert2 and sweetalert2 together, then configure the app with providers for standalone apps, or use the NgModule approach for older apps.
Which Angular versions does it support?
Angular 14 and later for the standalone approach. The README has a compatibility table for each version range.
Can I use my own templates in a popup?
Yes. The swalPortal directive lets you use Angular templates inside a SweetAlert2 popup.
Is it free?
Yes. The project is open source, and the code is on GitHub.
What are the best ngx-sweetalert2 alternatives?
Popular alternatives to ngx-sweetalert2 include sweetalert2, sweetalert2-react-content and ngx-spinner. See all ngx-sweetalert2 alternatives

















