Plugins
Barba plugins are components that you can plug to improve the default library behavior.
Available
Here is the list of all available plugins for Barba:
- @barba/router → allows you to use custom routes for page transitions
- @barba/prefetch → prefetches automatically and cache your pages
- @barba/css → a style helper that manage you CSS classes during transitions
- @barba/head → keep your
<head>
up to date (coming soon) - @barba/preset → ready-to-use basic transitions pack (coming soon)
Usage
To use a plugin, simply tell Barba what plugin(s) and option(s) you want to use before initialize it:
1 | import barba from '@barba/core'; |
Be careful, you can easily rename the import when using a bundler, which is not the case when using the plugin through a CDN: the name should be prefixed by
barba
, meaning@barba/plugin
will need to be call asbarba.use(barbaPlugin)
.