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

swup v3 swup v3 Slide Theme
GitHub swup on GitHub

Slide Theme

Theme for slide in/out animation. Makes content slide out (+fade) in one direction, and slide in from the other.

Installation

This theme can be installed with npm

npm install @swup/slide-theme

and included with import

import SwupSlideTheme from '@swup/slide-theme';

or included from the dist folder

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

Usage

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

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

Options

mainElement

Changes the selector of the elements to slide in/out.
Defaults to #swup.

reversed

Makes the direction reversed. Defaults to false.