MCPcopy Index your code
hub / github.com/swup/swup

github.com/swup/swup @4.9.2 sqlite

repository ↗ · DeepWiki ↗ · release 4.9.2 ↗
183 symbols 516 edges 70 files 32 documented · 17%
README

swup 4 is released  🎉  Check out the release notes and upgrade guide.

swup

npm version Bundle size npm downloads Test status License

Swup

Versatile and extensible page transition library for server-rendered websites.

FeaturesDemosPluginsThemesDocumentationDiscussions

Overview

Swup adds page transitions to server-rendered websites. It manages the complete page load lifecycle and smoothly animates between the current and next page. In addition, it offers many other quality-of-life improvements like caching, smart preloading, native browser history and enhanced accessibility.

Make your site feel like a snappy single-page app — without any of the complexity.

Features

  • ✏️ Works out of the box with minimal markup
  • ✨ Auto-detects CSS transitions & animations for perfect timing
  • 🔗 Updates URLs and preserves native browser history
  • 🏓 Manages the scroll position between pages and anchor links
  • 🚀 Uses a cache to speed up subsequent page loads
  • 📡 Offers hooks to customize and extend the page load lifecycle
  • 🔌 Has a powerful plugin system and many official and third-party plugins
  • 🎨 Provides ready-to-go themes to get started quickly

Demos

Explore our interactive demos to see swup in action.

Documentation

Visit our official documentation to learn more.

Plugins

Swup is small by design. Extended features can be added via plugins:

Check out the list of official and third-party plugins.

Themes

Get started quickly with one of three official themes: fade, slide, and overlay.

Examples

Take a look at the interactive demos and sites using swup for more examples.

Having trouble?

If you're having trouble implementing swup, check out the Common Issues section of the docs, look at closed issues or create a new discussion.

Want to Contribute?

We're looking for maintainers!   👀

Become a sponsor on Open Collective or support development through GitHub sponsors.

This project is tested with BrowserStack.

Extension points exported contracts — how you extend this code

HookRegistry (Interface)
(no doc) [1 implementers]
src/modules/Hooks.ts
HistoryState (Interface)
(no doc)
src/helpers/history.ts
CacheTtlData (Interface)
(no doc)
tests/unit/cache.test.ts
Window (Interface)
(no doc)
tests/support/swup.ts
VisitFrom (Interface)
(no doc)
src/modules/Visit.ts
CacheIndexData (Interface)
(no doc)
tests/unit/cache.test.ts
VisitTo (Interface)
(no doc)
src/modules/Visit.ts
AugmentedCacheData (Interface)
(no doc)
tests/unit/cache.test.ts

Core symbols most depended-on inside this repo

on
called by 91
src/modules/Hooks.ts
expectToBeAt
called by 90
tests/support/commands.ts
navigateWithSwup
called by 57
tests/support/swup.ts
call
called by 52
src/modules/Hooks.ts
set
called by 30
src/modules/Hooks.ts
clickOnLink
called by 21
tests/support/commands.ts
expectPageReload
called by 13
tests/support/commands.ts
get
called by 12
src/modules/Hooks.ts

Shape

Function 76
Method 63
Class 24
Interface 20

Languages

TypeScript100%

Modules by API surface

src/modules/Hooks.ts29 symbols
tests/support/commands.ts21 symbols
src/modules/Visit.ts17 symbols
src/modules/Cache.ts14 symbols
src/modules/Classes.ts10 symbols
src/Swup.ts10 symbols
tests/unit/hooks.test.ts8 symbols
tests/support/swup.ts8 symbols
src/modules/awaitAnimations.ts8 symbols
src/utils/index.ts7 symbols
src/modules/fetchPage.ts6 symbols
src/helpers/Location.ts6 symbols

Dependencies from manifests, versioned

@babel/preset-typescript7.18.6 · 1×
@eslint/js10.0.1 · 1×
@playwright/test1.58.2 · 1×
@swup/browserslist-config1.0.0 · 1×
@swup/prettier-config1.0.0 · 1×
@types/dom-view-transitions1.0.2 · 1×
@types/jsdom28.0.0 · 1×
actions-up1.12.0 · 1×
delegate-it6.0.0 · 1×
eslint10.0.2 · 1×

For agents

$ claude mcp add swup \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact