Modern page transition library for creating fluid, smooth transitions between website pages. Barba.js makes multi-page websites feel like Single Page Applications (SPAs) by hijacking navigation and managing transitions without full page reloads.
Confirm successful installation by checking the skill directory location:
.cursor/skills/barba-js
Restart Cursor to activate barba-js. Access via /barba-js in your agent's command palette.
β
Security Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Modern page transition library for creating fluid, smooth transitions between website pages. Barba.js makes multi-page websites feel like Single Page Applications (SPAs) by hijacking navigation and managing transitions without full page reloads.
Overview
Barba.js is a lightweight (7kb minified and compressed) JavaScript library that intercepts navigation between pages, fetches new content via AJAX, and smoothly transitions between old and new containers. It reduces page load delays and HTTP requests while maintaining the benefits of traditional multi-page architecture.
Core Features:
Smooth page transitions without full reloads
Lifecycle hooks for precise control over transition phases
View-based logic for page-specific behaviors
Built-in routing with @barba/router plugin
Extensible plugin system
Small footprint and high performance
Framework-agnostic (works with vanilla JS, GSAP, anime.js, etc.)
Core Concepts
1. Wrapper, Container, and Namespace
Barba.js uses a specific DOM structure to manage transitions:
Everything inside wrapper but outside container stays persistent
Ideal for headers, navigation, footers that don't change
Container (data-barba="container")
Dynamic content area that updates on navigation
Only this section gets replaced during transitions
Must exist on every page
Namespace (data-barba-namespace="home")
Unique identifier for each page type
Used in transition rules and view logic
Examples: "home", "about", "product", "blog-post"
2. Transition Lifecycle
Barba.js follows a precise lifecycle for each navigation:
Default Async Flow:
User clicks link
Barba intercepts navigation
Prefetch next page (via AJAX)
Cache new content
Leave hook - Animate current page out
Wait for leave animation to complete
Remove old container, insert new container
Enter hook - Animate new page in
Wait for enter animation to complete
Update browser history
Sync Flow (with sync: true):
User clicks link
Barba intercepts navigation
Prefetch next page
Wait for new page to load
Leave and Enter hooks run simultaneously (crossfade effect)
Swap containers
Update browser history
3. Hooks
Barba provides 11 lifecycle hooks for controlling transitions:
Hook Execution Order:
Initial page load:
beforeOnce β once β afterOnce
Every navigation:
before β beforeLeave β leave β afterLeave β
beforeEnter β enter β afterEnter β after
Hook Types:
Global hooks: Run on every transition (barba.hooks.before())
Transition hooks: Defined within specific transition objects
View hooks: Defined within view objects for page-specific logic
importbarbafrom'@barba/core';barba.init({transitions:[{name:'default',leave({ current }){// Fade out current pagereturn gsap.to(current.container,{opacity:0,duration:0.5});},enter({ next }){// Fade in new pagereturn gsap.from(next.container,{opacity:0,duration:0.5});}}]});
2. Fade Transition (Async)
Classic fade-out, fade-in transition:
importbarbafrom'@barba/core';importgsapfrom'gsap';barba.init({transitions:[{name:'fade',asyncleave({ current }){await gsap.to(current.container,{opacity:0,duration:0.5,ease:'power2.inOut'});},asyncenter({ next }){// Start invisible gsap.set(next.container,{opacity:0});// Fade inawait gsap.to(next.container,{opacity:1,duration:0.5,ease:'power2.inOut'});}}]});
3. Crossfade Transition (Sync)
Simultaneous fade between pages:
β
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
βΊAccess to product documentation and roadmap tools (Jira, Notion, etc.)
βΊUnderstanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
βΊStakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Steps
1Install product management skill
2Start with user story generation for known feature
3Progress to competitive analysis: research 2-3 competitors
4Use for roadmap prioritization: apply RICE/ICE scoring
5Draft stakeholder communications and refine based on feedback
6Build template library for recurring PM tasks
7Share effective prompts with product team
Common Pitfalls
β Not validating competitive researchβverify facts before sharing
β Accepting user stories without involving engineering team
β Over-relying on frameworks without qualitative judgment
β Not customizing outputs to company culture and communication style
β Skipping stakeholder validation of generated requirements
Best Practices
β Do
+Validate research and competitive analysis with real data
+Collaborate with engineering when generating technical requirements
+Customize frameworks and templates to your company context
+Use skill for first drafts, refine with stakeholder input
+Document successful prompt patterns for PM tasks
+Combine AI efficiency with human judgment and intuition
β Don't
βDon't publish competitive analysis without fact-checking
βDon't finalize user stories without engineering review
βDon't make prioritization decisions solely on AI scoring
βDon't skip customer validation of generated requirements
βDon't ignore company-specific context and culture
π‘ Pro Tips
β Provide context: company goals, constraints, customer feedback
β Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
β Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
β Use skill for 70% generation + 30% customization to company needs
When to Use This
β Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
β Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path
1Basic: user stories, feature specs, status updates