Create badass, fluid and smooth transitions between your website’s pages.
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 user's web experience.
transitions
and views
data-barba
attributes@barba/router
: use of routes for transition resolution
@barba/css
: automatic addition of CSS classes@barba/prefetch
: automatic pages prefetching (and caching), based on viewport@barba/head
: update your <head>
(coming soon)
@barba/preset
: ready-to-use basic transitions pack (fade, slide, …) (coming soon)
data-barba-*
attributes:
barba.init()
for transitions, views and Barba core settingsbarba.use()
for plugins (router, css, prefetch, etc.)barba.init({ transitions })
this.async()
or Promise based)data
argument
namespace
and custom
@barba/router
adds route
rulefrom
and to
propertiesbarba.init({ views })
beforeOnce
, afterOnce
, beforeLeave
, afterLeave
, beforeEnter
, afterEnter
data
argument
leave
and enter
transitions concurrentlyIf you want to report a bug or if you just want to request for a new feature/improvement, please follow those instructions before.
Thanks for taking time to contribute to Barba :tada: :+1: