# barba **Repository Path**: studvc/barba ## Basic Information - **Project Name**: barba - **Description**: Create badass, fluid and smooth transition between your website's pages. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-01-05 - **Last Updated**: 2021-01-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # barba.js [v2]  [](https://circleci.com/gh/barbajs/barba/tree/master) [](https://coveralls.io/github/barbajs/barba?branch=master) [](http://commitizen.github.io/cz-cli/) [](https://conventionalcommits.org) [](https://lernajs.io/) [](https://github.com/barbajs/barba/blob/master/LICENSE) [](#contributors) [](https://barbajs.slack.com) > [Invite link to slack channel](https://join.slack.com/t/barbajs/shared_invite/enQtNTU3NTAyMjkxMzAyLTkxYWUwZmM1YWQxMmNlYmE0ZjY4NDQxMGUxYjkwYWFlMzEzOWM4OTRhMWRmYTQyYzFlMmQ3OGFmYmI3MWY0OWY) **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. ## Documentation - [Site](https://barba.js.org/) - [User guide](https://barba.js.org/docs/getstarted/intro/) - [API documentation](https://barba.js.org/api/) ## What's new? - Simplified API - Hook sytem for `transitions` and `views` - _Transition resolution_: declare your transitions and let Barba pick the right one - Use of `data-barba` attributes - Sync mode - Plugin system - `@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 `
` _(coming soon)_ - `@barba/preset`: ready-to-use basic transitions pack (fade, slide, β¦) _(coming soon)_ ## Main changes (TL;DR) - Barba now use `data-barba-*` attributes: - data-barba-wrapper for the [wrapper](https://barba.js.org/docs/getstarted/markup/#Wrapper) - data-barba-container for the [container](https://barba.js.org/docs/getstarted/markup/#Container) - data-barba-namespace for the [namespace](https://barba.js.org/docs/getstarted/markup/#Namespace) - 2 main methods: - `barba.init()` for transitions, views and Barba core settings - `barba.use()` for plugins (router, css, prefetch, etc.) - [Transitions](https://barba.js.org/docs/advanced/transitions/): - are plain JS objects - are declared via the `barba.init({ transitions })` - use "[hooks](https://barba.js.org/docs/advanced/hooks/)" corresponding to animation steps - hooks can be synchronous or asynchronous (via `this.async()` or Promise based) - all hooks receive same [`data` argument](https://barba.js.org/docs/advanced/hooks/#data-argument) - use "[rules](https://barba.js.org/docs/advanced/transitions/#Rules)" to select which transition to use - default rules are `namespace` and `custom` - `@barba/router` adds `route` rule - they can be combined within `from` and `to` properties - [Views](https://barba.js.org/docs/advanced/views/): - are plain JS objects - are declared via the `barba.init({ views })` - use a subset of animation "hooks": - `beforeOnce`, `afterOnce`, `beforeLeave`, `afterLeave`, `beforeEnter`, `afterEnter` - receive the same [`data` argument](https://barba.js.org/docs/advanced/hooks/#data-argument) - [Sync mode](https://barba.js.org/docs/advanced/transitions/#Sync-mode) will start `leave` and `enter` transitions concurrently ## How to contribute If you want to report a bug or if you just want to request for a new feature/improvement, please **follow [those instructions](CONTRIBUTING.md) before**. Thanks for taking time to contribute to Barba :tada: :+1: ## Contributors