barba-js

Manage page navigation without full reloads using Barba.js transitions.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/ayofemiade/cleva --skill barba-js-ayofemiade
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: barba-js
Source: https://github.com/ayofemiade/cleva/tree/main/.claude/skills/barba-js
Command: npx skills add https://github.com/ayofemiade/cleva --skill barba-js-ayofemiade

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill allows you to implement smooth, single-page application-like page transitions on your website using Barba.js, eliminating the need for full page reloads.

Core Features & Use Cases

  • Page Transitions: Implement fluid transitions between pages, creating a more engaging user experience.
  • SPA-like Navigation: Navigate between pages without full page reloads, similar to single-page applications.
  • Custom Transitions: Define custom transition animations for specific pages or global behaviors.
  • Use Case: Use this Skill to add smooth transitions to a product landing page, enhancing the user experience by keeping the user on the same page for related content.

Quick Start

To set up a simple fade transition for the home page, use the following code snippet:

barba.init({
  transitions: [{
    name: 'fade',
    leave({ current }) {
      return gsap.to(current.container, { opacity: 0, duration: 0.5 });
    },
    enter({ next }) {
      return gsap.from(next.container, { opacity: 0, duration: 0.5 });
    }
  }]
});

Frequently Asked Questions about barba-js

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

FAQPage Schema
How do I add smooth page transitions to my website without full page reloads?

Smooth page transitions are achieved by intercepting navigation links to load subsequent pages dynamically, creating a single-page application experience. This eliminates the need for full page reloads during website navigation.

Can I create custom SPA navigation animations for specific pages using Barba.js?

Yes, custom SPA navigation animations can be defined for specific pages or applied as global behaviors. You manage these custom transitions by configuring the Barba.js library to handle the leave and enter hooks for your website.

Does implementing SPA-like page transitions require a specific JavaScript environment?

Implementing SPA-like page transitions requires a JavaScript environment that includes the @barba/core dependency. This library is necessary to intercept navigation events and manage the transition lifecycle between website pages.

What is the best way to set up a simple fade transition for website navigation?

The best way to set up a simple fade transition is to initialize the Barba.js library with a transition object. This object defines the leave and enter animations, using an animation library like GSAP to fade the page opacity out and in.

Why use Barba.js for single-page application-like navigation instead of a traditional SPA framework?

Using Barba.js provides SPA-like navigation by enhancing an existing multi-page website with smooth transitions. It avoids the architectural complexity of migrating to a full SPA framework while still eliminating disruptive full page reloads.