barba-js

Implements smooth page transitions between website pages using Barba.js and GSAP.

Updated Aug 12, 2026
One-click install
npx skills add https://github.com/sixscripts-ai/agent-arena-voice --skill barba-js-sixscripts-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: barba-js
Source: https://github.com/sixscripts-ai/agent-arena-voice/tree/main/.claude/plugins/claudedesignskills/plugins/bundles/extended-3d-scroll/skills/barba-js
Command: npx skills add https://github.com/sixscripts-ai/agent-arena-voice --skill barba-js-sixscripts-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @barba/core, gsap, vite, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Multi-page websites traditionally reload the entire page on every navigation, causing jarring flashes, lost scroll state, and slow perceived performance. This Skill helps you implement Barba.js to intercept navigation, fetch pages via AJAX, and animate transitions so multi-page sites feel like single-page applications. ## Core Features & Use Cases - Transition System: Define fade, slide, scale, stagger, and curtain transitions with lifecycle hooks (leave, enter, sync mode) and conditional rules based on namespace or route. - Views and Hooks: Run page-specific initialization and cleanup logic per namespace, plus global hooks for analytics, scroll reset, and third-party script re-initialization. - Project Scaffolding: Generate a complete Barba.js + GSAP + Vite starter project with example pages, or generate standalone transition boilerplate code. - Use Case: You are building a portfolio site with separate HTML pages and want a crossfade animation when visitors click between Home, About, and Contact, while keeping the header persistent and tracking pageviews in analytics. ## Quick Start Ask the AI to set up Barba.js page transitions with a fade animation for your multi-page website using GSAP.

Frequently Asked Questions about barba-js

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add page transitions to a multi-page website?

Use Barba.js to intercept link clicks and swap page content via AJAX. Add data-barba="wrapper" and data-barba="container" attributes to your HTML, then define leave and enter animations with GSAP in barba.init() transitions.

How to use Barba.js with GSAP for animations?

Return GSAP tweens or timelines from Barba's leave and enter hooks, since GSAP animations return promises that Barba awaits. Use gsap.set() in beforeEnter to establish initial states and prevent content flashing.

What is the difference between sync and async transitions in Barba.js?

Async mode (default) runs the leave animation, waits, swaps containers, then runs enter. Sync mode (sync: true) runs leave and enter simultaneously for crossfade effects, but requires absolute positioning to prevent layout shift.

Why does my Barba.js transition finish instantly without animating?

The leave or enter hook is not returning a promise, so Barba does not wait for the animation. Return the GSAP tween directly or declare the hook as async and await the animation.

Does Barba.js update the page title and meta tags on navigation?

Not by default. Install the @barba/head plugin to automatically sync title, meta, and link tags, or update them manually in the barba.hooks.after() hook by parsing next.html.

How do I run page-specific JavaScript with Barba.js?

Define views in barba.init() with a namespace matching your data-barba-namespace attribute. Use afterEnter to initialize page features like sliders and beforeLeave to clean up event listeners and animations.