@sweetalert2/themes - Official Themes for SweetAlert2
Caution
THESE PACKAGES ARE DEPRECATED. Themes are now built-in into the sweetalert2 package itself.
See the official documentation at https://sweetalert2.github.io/#themes for more information on how to use the built-in themes.
You can install all themes at once:
npm install --save @sweetalert2/themesOr just a single theme @sweetalert2/theme-<theme_name>, e.g.
npm install --save @sweetalert2/theme-darkOr grab them both from jsdelivr CDN, for example:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-dark@5/dark.css" />
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.js"></script>With CSS:
<!-- Include a required theme -->
<link rel="stylesheet" href="@sweetalert2/themes/dark/dark.css" />
<script src="sweetalert2/dist/sweetalert2.min.js"></script>With SASS:
your-app.js:
import Swal from 'sweetalert2/dist/sweetalert2.js';your-app.scss:
@import '@sweetalert2/themes/dark/dark.scss';If you would like to contribute enhancements or fixes, please do the following:
-
Fork the
sweetalert2-themesrepository and clone it locally. -
When in the
sweetalert2-themesdirectory, runyarn installto install dependencies. -
To begin active development, run
yarn startandyarn watchsimultaneously. -
Or, if you want to quickly start a new theme, run
yarn create-new-theme my-awesome-theme. This will create the theme's default files.
Has SweetAlert2 helped you create an amazing application? You can show your support by making a donation: