Create badass, fluid and smooth transitions between your website’s pages.
Intro
Barba.js — aka Barba — 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 makes your website run like a SPA (Single Page Application) and help reduce the delay between your pages, minimize browser HTTP requests and enhance your user's web experience.
Features
Barba is user friendly, smart, extensible and futureproof. The library provides a bunch of useful features that will make your website shine like any other website, ever!
- Simplified API - written in TypeScript and works with
Promises
- Cross-browser support - progressive enhancement for modern browsers
- DOM flexibility - custom markup, namespaces and
data
attribute schema - Hook system - regulars lifecycle methods for
Transitions
andViews
- Transition resolution - rules that let Barba pick the right transition
- Sync mode - indicates whether leave and enter hooks should “play together”
- Page related code - custom logic attached to a specific
View
- Modern browser strategies - keep your site run as fast as possible
- Cook like an expert - improve your development workflow
- Built-in utilities - brought to you with a bunch of useful methods
- Plugin system - supplied with useful plugins
- Wide community - more than 980+ amazing developers can help build your website!
Documentation
Here you will find the documentation describing how to use the library.
- Website - official Barba website
- User guide - how to install and use the plugin
- Lessons, courses and videos - for in-depth learning
- Showcase - selected works made with Barba
- Developer API - by developers, for developers
Note
This guide assumes intermediate knowledge of HTML, CSS, and JavaScript. It is worth mentioning that all code examples use ES6+ syntax. If you are not comfortable with this syntax, we would encourage you to grasp the basics then come back.
In case of emergency, check the "legacy" code example.
Sponsor
If you like this library and want to give some recognition, it is now possible to become a Github sponsor and support this project by sponsoring BarbaJS maintainer on Github. Even if it's a small contribution, you participate in the effort of making open source projects maintained for anyone, and developers to be rewarded for their work/time.
Contribute
If you want to report a bug or request a new feature/improvement, please read the project contributors guidelines before.
Thanks for taking time to contribute to Barba 🎉 👍
Contributors
License
The project is developed under the MIT license:
- Permissions: This software and derivatives may be used for commercial purposes, you may distribute this software, this software may be modified and you may use and modify the software without distributing it.
- Conditions: Include a copy of the license and copyright notice with the code.
- Limitations: Software is provided without warranty and the software author/license owner cannot be held liable for damages.
Read the full license for more information about your rights.