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

swup v3 swup v3 Laravel Livewire Plugin
GitHub swup on GitHub

Laravel Livewire Plugin

Laravel Livewire doesn't work by default with Swup. The Livewire components work on initial page load but stop working on subsequent pages rendered by Swup. This plugin fixes this issue and brings support for Laravel Livewire to Swup.

Installation

This plugin can be installed with npm

npm install @swup/livewire-plugin

and included with import

import SwupLivewirePlugin from '@swup/livewire-plugin';

or included from the dist folder

<script src="./dist/SwupLivewirePlugin.js"></script>

Usage

To run this plugin, include an instance in the swup options.

const swup = new Swup({
  plugins: [new SwupLivewirePlugin()]
});