Look at the top-tier websites winning Awwwards in 2026. You will notice a striking absence of standard, rigid image sliders. When a user interacts with a premium brand, they don’t want to patiently click a tiny right arrow and wait for an image to linearly slide into place. They want to grab the interface, throw it, and watch it react with mathematical precision.
If you are a web designer relying on default slider widgets, your websites feel outdated. To command premium pricing, you must master the art of tactile motion. If you want to know how to build a custom GSAP carousel in Bricks Builder, you are in the right place.
In this expert guide, we are going to tear down the traditional slider. I will teach you the core principles of high-end GSAP slider animation, how to leverage the clean code architecture of Bricks Builder, and provide the exact JavaScript to create a draggable, physics-based gallery that feels like a native mobile app.
The Problem with Traditional WordPress Sliders

Before we write code, we must understand the enemy: Bloat and Linear Motion.
When you install a heavy commercial slider plugin, you are loading hundreds of kilobytes of unused CSS and JavaScript across your entire site. This destroys your LCP (Largest Contentful Paint) scores.
Furthermore, the user experience is almost always flawed. Standard sliders use generic CSS transitions. When a user swipes on mobile, the slider often snaps rigidly from one slide to the next. It lacks Inertia. It lacks Edge Resistance (that satisfying rubber-band effect when you pull too far).
To achieve a truly premium feel, we must bypass CSS transitions entirely and use a dedicated animation engine: GSAP (GreenSock Animation Platform).
The Perfect Synergy: Bricks Builder + GSAP
Why are we using Bricks Builder for this? Why not Elementor or Divi?
Because GSAP is heavily reliant on the DOM (Document Object Model). Heavy page builders wrap a simple text element in 4 or 5 unnecessary
tags (Div Soup). When GSAP tries to animate these complex, nested elements, the browser CPU bottlenecks, causing layout thrashing and dropped frames.
Bricks Builder outputs semantic, bare-metal HTML. If you create a block in Bricks, it outputs exactly one
. This allows GSAP to target elements with surgical precision, ensuring your animations run at a flawless 60fps on the GPU.
Step 1: Architecting the DOM in Bricks Builder
To build a high-performance GSAP carousel, we need a specific three-tier structure. Build this using standard Block elements in Bricks:
-
The Viewport (
.slider-viewport): This acts as the window hiding the overflow. -
The Track (
.slider-track): This is the long, invisible train that holds all the cards. This is what we will actually drag. -
The Cards (
.slider-card): Your individual gallery items or products.
Bricks Builder CSS Setup
In the Bricks visual interface, apply these crucial CSS settings:
-
.slider-viewport: Set Width to100%, and Overflow tohidden. -
.slider-track: Set Display toflex, Direction torow, and Gap to30px(or whatever you prefer). Do not set wrapping. -
.slider-card: Set Flex-shrink to0(so they don’t squash together), and set a fixed width (e.g.,400pxor80vwfor mobile).
Your clean HTML structure is now ready for the JavaScript engine.
Step 2: The Core GSAP Slider Animation Code
We are going to use GSAP’s Draggable plugin. This isn’t just about moving a div; it’s a robust physics engine that normalizes touch and mouse events across all devices.
Add an HTML element to your Bricks page (or use Bricks’ page settings for custom code) and insert this script. Note: Ensure you have loaded the GSAP Core and Draggable scripts via your child theme or a script manager first.
document.addEventListener("DOMContentLoaded", () => {
// Register the Draggable plugin
gsap.registerPlugin(Draggable);
const track = document.querySelector('.slider-track');
const viewport = document.querySelector('.slider-viewport');
// Initialize Draggable
Draggable.create(track, {
type: "x", // Restrict dragging to the horizontal axis
bounds: viewport, // Prevent dragging the track completely off-screen
edgeResistance: 0.85, // Creates a premium "rubber-band" bounce at the ends
dragClickables: true, // Allows clicking links inside the cards
// Optional: If you have Club GreenSock, adding Inertia makes it frictionless
// inertia: true,
onDragStart: function() {
// Add a class to change the cursor to 'grabbing'
viewport.classList.add("is-dragging");
},
onDragEnd: function() {
// Remove the grabbing cursor
viewport.classList.remove("is-dragging");
}
});
});With just a few lines of code, you have replaced a massive slider plugin with an ultra-lightweight, high-performance interaction.
Step 3: Elevating the UX (Adding Image Parallax)
If you want to move from “Good” to “Award-Winning,” dragging the track isn’t enough. We need secondary motion.
When the user drags the carousel to the left, the images inside the cards should subtly shift to the right. This creates a 2.5D spatial parallax effect that looks incredibly expensive.
Here is how we update our GSAP code to hook into the onDrag event:
document.addEventListener("DOMContentLoaded", () => {
gsap.registerPlugin(Draggable);
const track = document.querySelector('.slider-track');
const viewport = document.querySelector('.slider-viewport');
const cards = document.querySelectorAll('.slider-card img'); // Target the images inside
Draggable.create(track, {
type: "x",
bounds: viewport,
edgeResistance: 0.85,
onDrag: function() {
// The magic formula: as the track moves, move the images the opposite way
// We divide by a factor (e.g., 5) to make it a subtle parallax, not a 1:1 move
gsap.to(cards, {
x: this.x / 5,
ease: "none", // Must be none to perfectly sync with the drag
duration: 0.1
});
}
});
});This is the exact technique used by top-tier agencies. By binding internal element transforms to the overall drag progress, you create a deeply immersive web experience.
Real-World Inspiration: Masterclasses in Carousel Design
If you want to see the benchmark for what we are building, study these industry leaders:
-
Apple.com: Apple rarely uses click-arrows. Their product gallery sections are almost always fluid drag carousels with heavy edge resistance, making their digital products feel as tactile as their physical ones.
-
Cuberto (Design Studio): Famous for their cursor interactions, Cuberto uses GSAP carousels where the custom cursor expands into a “Drag” bubble when hovering over the viewport, clearly signaling the interaction model to the user.
-
Awwwards Portfolios: Look at any recent “Site of the Day” winner featuring a horizontal project gallery. The fluidity of the scroll and drag mechanics is almost universally powered by custom GSAP integration, completely bypassing native CSS snapping.
Comparative Table: Traditional Plugins vs. Custom GSAP
To clearly understand the business and technical value of this architecture, let’s review the data:
| Metric | Traditional Slider Plugin | GSAP in Bricks Builder | UX & Business Impact |
| DOM Weight | 🔴 Extremely Heavy (Div Soup) | 🟢 Ultra-Light (Semantic HTML) | Faster LCP & better SEO rankings. |
| Motion Physics | 🟡 Linear CSS Transitions | 🟢 Complex Math (Edge Resistance) | Premium Brand Perception; feels like an app. |
| Customization | 🔴 Locked into plugin UI limits | 🟢 Absolute (Bind anything to onDrag) |
Allows for Bespoke Agency Design. |
| Mobile Touch | 🟡 Often conflicts with vertical scroll | 🟢 Normalizes touch events perfectly | Lower Bounce Rates on mobile devices. |
FAQ: Troubleshooting GSAP Sliders in Bricks
Q1: How do I handle responsive card widths on mobile? A: Because Bricks Builder allows you to use standard CSS units, you can simply set your .slider-card width to 80vw (80% of the viewport width) on mobile breakpoints in the Bricks interface. GSAP doesn’t care about the CSS width; it will automatically adapt the drag boundaries based on the total width of the .slider-track.
Q2: Why is my dragging conflicting with vertical page scrolling on my iPhone? A: This is a common issue with touch interfaces. GSAP Draggable is very smart. When you set type: "x", it automatically injects touch-action: pan-y into the element’s CSS. This tells the mobile browser to allow native up-and-down scrolling, but hijacks left-and-right swipes for your carousel. Ensure you do not have any global CSS that overrides touch-action.
Q3: Does using JavaScript for layout animation hurt my Core Web Vitals? A: Only if you animate the wrong properties. If you animate margin, width, or left, you will cause Layout Thrashing, which destroys performance. Because we are using GSAP to animate x (which translates to transform: translateX()), the browser offloads the work entirely to the GPU. Your animation will run at a flawless 60fps without hurting your Core Web Vitals.
Conclusion & Next Steps
Learning how to build a custom GSAP carousel in Bricks Builder is a turning point in a frontend developer’s career. You transition from a “theme customizer” to a “digital architect.”
By stripping away bloated plugins and leveraging raw GSAP slider animation, you take absolute control over the physics, performance, and narrative of your website. You give your users a tactile, premium experience that directly translates to higher brand authority and better conversion rates.
Your next step: Open up a sandbox environment in Bricks Builder. Create the 3-layer DOM structure (Viewport > Track > Cards), inject the Draggable script, and feel the difference for yourself. Stop relying on the tools of the past, and start engineering the web of the future.

