Barba.js is a small (7kb minified and compressed) and easy-to-use library that helps you create fluid and smooth transitions between your website’s pages.
It helps reduce the delay between your pages, minimize browser HTTP requests and enhance your users’ web experience.
In case of emergency, check this “legacy” code example.
- User guide
- API documentation
- Github repo
- Slack channel (Not in the channel? Use the invite link 👋🏻)
npm install @barba/core
or using yarn:
yarn add @barba/core
or using a CDN:
See @barba/core for more details…
// do not import Barba like this if you load the library through the browser
Barba.js can be viewed as a progressive enhancement.
Main “modern features” used are:
@barba/prefetchalso uses IntersectionObserver
Cross-browser support is as follows:
- without polyfills: modern browsers (Chrome, Firefox, Edge, Safari, Opera)
- with polyfills for abovementioned: + IE10
You can use polyfill.io: