You are browsing the docs for swup 3.
Click here for the latest version.

swup v3 swup v3 Create a Plugin 🎉
GitHub swup on GitHub

Create a Plugin 🎉

Anyone can create and publish swup plugins. To create new plugin, install swup CLI which can create one from a template for you.

Alternatively you can head over to this template repo and follow the instructions there.

Tips

  • Checkout existing plugins before creating one.
  • Swup instance is automatically assigned to the plugin instance and can be accessed under this.swup in mount/unmount methods.
  • If you feel like this should be an official swup plugin (under npm @swup organization) and the world could use a thing like this, contact me at gmarcuk@gmail.com.
  • Use swups log method to output any relevant information. By default the method doesn't do anything, but swup does output any calls in case debug plugin is used.
  • All plugins should clean up any changes to swup/event listeners in umount method.