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

swup v3 swup v3 Overlay Theme
GitHub swup on GitHub

Overlay Theme

Theme for slide in/out animation of overlay.

Installation

This theme can be installed with npm

npm install @swup/overlay-theme

and included with import

import SwupOverlayTheme from '@swup/overlay-theme';

or included from the dist folder

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

Usage

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

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

Options

color

Changes color of the overlay element. Defaults to #2D2E82.

duration

Changes the duration of the overlay animation. Defaults to 600 (ms).

direction

Changes the direction of the overlay animation. Defaults to to-right. Available values: to-right, to-left, to-bottom and to-top.

Default options

new SwupOverlayTheme({
    color: '#2D2E82',
    duration: 600,
    direction: 'to-right',
});