barba-js

Intercept internal link clicks and animate container swaps without full reloads.

Updated May 7, 2026
One-click install
npx skills add https://github.com/TumeloRamaphosa/StudEx-Valley-OS --skill barba-js-tumeloramaphosa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: barba-js
Source: https://github.com/TumeloRamaphosa/StudEx-Valley-OS/tree/main/.claude/skills/claudedesignskills/plugins/bundles/extended-3d-scroll/skills/barba-js
Command: npx skills add https://github.com/TumeloRamaphosa/StudEx-Valley-OS --skill barba-js-tumeloramaphosa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) and references (resource) components.

What problem does it solve?

Barba.js removes the jarring experience of full page reloads by making multi-page sites feel like single-page applications through animated, seamless navigation.

Core Features & Use Cases

  • Fluid SPA-like navigation: Hijacks internal link clicks, fetches new content, and swaps containers without full reloads for a polished user experience.
  • Lifecycle hooks for precise control: Use beforeLeave, leave, beforeEnter, enter, and afterEnter to coordinate animations and per-page logic with deterministic timing.
  • Route and namespace-aware transitions: Apply different transitions per data-barba-namespace or by route when using @barba/router, enabling context-specific effects (e.g., home→product vs product→product).
  • GSAP-ready animation workflows: Works with GSAP (and patterns like gsap-scrolltrigger) to implement fade, slide, crossfade (sync), and timeline-driven transitions.
  • Performance-friendly enhancements: Supports prefetching patterns (via @barba/prefetch) and common best practices to reduce flicker and layout shifts during transitions.

Quick Start

Use the barba-js skill to implement GSAP-powered page transitions by wiring your app’s persistent wrapper and dynamic container structure to Barba’s hooks and transition rules.

Frequently Asked Questions about barba-js

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

FAQPage Schema
How do I create smooth page transitions without full page reloads?

Smooth page transitions without full reloads are created by intercepting internal link clicks, fetching new content, and animating container swaps using lifecycle hooks. This approach makes multi-page sites feel like single-page applications with fluid navigation.

Can I use GSAP for enter and leave animations during page navigation?

Yes, GSAP can be used for enter and leave animations during page navigation. The system supports GSAP-ready workflows, allowing you to implement fade, slide, crossfade, and timeline-driven transitions coordinated through deterministic lifecycle hooks.

How do I apply different page transition effects based on the route or page?

Different page transition effects are applied using route and namespace-aware transitions. By assigning data-barba-namespace attributes or using a router plugin, you can trigger context-specific effects like different animations for home-to-product versus product-to-product navigation.

What DOM structure is needed to implement SPA-like navigation transitions?

Implementing SPA-like navigation transitions requires a persistent wrapper element containing a dynamic container element with a defined namespace. This Barba wrapper, container, and namespace DOM structure must be wired to transition definitions and lifecycle hooks to function correctly.

How do lifecycle hooks control the timing of page transition animations?

Lifecycle hooks control animation timing by providing sequential triggers like beforeLeave, leave, beforeEnter, enter, and afterEnter. These hooks allow you to coordinate per-page logic and execute animations with deterministic timing during the container swap process.

What is the best way to prevent flicker and layout shifts during animated page transitions?

Preventing flicker and layout shifts during animated page transitions involves using performance-friendly enhancements like prefetching patterns. Following common best practices alongside these prefetch plugins reduces visual disruptions during seamless navigation.