Package Spotlight: Sweetalert2


You know those awful native browser alerts and prompts? Don’t you wish you could switch them out for something a bit nicer looking? Something that just worked out the box for a simple alert and even something… more? Well, introducing Sweetalert2!

netsells

Sweetalert2 is the actively maintained successor of the highly popular drop-in modal package sweetalert by t4t5. Forked from the original package at the beginning of 2015, sweetalert2 is not a new package by any means, but it is actively maintained and and crammed with extra handy features, and that’s what’s important.

I’ve implemented numerous fixes and the main build process to bundle the package, so I’m quite close to the project myself. Utilising rollup.js I added functionality to efficiently build for both commonjs, umd, and the ability to add more in the future. I also overhauled the general codebase from a single file to a more ES6 module-based setup.

Owner of this supported fork, limonte, has done a great job of adding new features at the request of the community and being there to assist and fix issues promptly, with the help of his team of contributors. The package boasts the following features:

  • Promise-based modals
  • Plugin API methods
  • Multiple alert types (success, error, warning, info, question)
  • A whole host of configuration options to customise your alert
  • Chaining functionality using queues
  • Tests!

If you haven’t checked it out yet, and are in the market for a new alert package, I would recommend you head over to the docs and take a look for yourself. And if you know anyone still using the original package, make sure you point them in the right direction, because remember, friends don’t let friends use unmaintained software.

Related Posts

New package - Nuxt Lighthouse Module

Implementing automated Lighthouse audits on each deploy of your Nuxt.js application.

New package - Storybook Directories

A simple module for generating your storybook story structure based on your directory structure.

Gitprefix - Automatically formatting commit messages

Git precommit hook for appending branch and emoji prefixes

Automated Pull Request Checks on Github

Using Probot to create automated checks on Github Pull Requests

Netsells 💙 Vue (+ Vue.js London)

Why we at Netsells love the Vue.js framework and where you can find us later this week

Maximising Productivity with Slack

Staying productive with your favourite workplace chat app

Stop with the unhelpful loading spinners

Give some context to your users with some helpful loading text

Responsive Blocks and Vertical Alignment

How to create responsive cross-browser blocks with vertically aligned content

Development Goals for 2018

New Year Promise.resolve()

Progressively Infiltrating Google

Attending the Google Academy for a course on Progressive Web Apps