Theme Stack Guide
Choose, customize, and get the most from Shopify themes

How do you add a before-and-after image comparison slider to a Shopify theme?

Before-and-after sliders show transformations with one draggable divider. Add one with a section built from a lightweight slider script, keep both images identically sized and aligned, and test the drag interaction on touch devices before shipping.

A before-and-after comparison slider is one of the highest-converting elements a Shopify theme can carry: one draggable divider, two images, and the shopper controls the reveal. It works for skincare results, furniture restorations, room makeovers, and any product with a visible transformation. Adding one to a Shopify theme is straightforward, but the implementation details decide whether it feels premium or janky.

Option one: the app embed route

Several slider apps ship as theme app embeds, which means you can add the slider to any template through the theme editor without touching code. This is the fastest path and the right choice if you need one slider on one page and do not want maintenance burden. The tradeoff is styling: app embeds bring their own markup, and matching your theme's typography and spacing exactly can be fiddly.

Evaluate app options on touch behavior first. The slider's entire job is dragging, and many implementations handle mouse input fine but stutter on touch. Test on a real phone before committing, and check the app's impact on page weight: a slider that adds half a megabyte of JavaScript to every page is a bad trade.

Option two: build a custom section

For full control, build a custom section with two image pickers, a divider position setting, and labels for each side. The slider itself needs only a small amount of JavaScript: track pointer position over the container, clip the top image with a CSS clip or width, and move the divider handle. Well under a hundred lines, and it can live entirely in the section file.

Use pointer events rather than separate mouse and touch handlers, so one code path covers both. Add keyboard support on the handle, since a draggable divider is otherwise invisible to keyboard users, and respect reduced-motion preferences by rendering a static split view when requested. These details are what separate a professional implementation from a demo.

Option three: the no-JavaScript fallback pattern

If the transformation matters for SEO or for shoppers with JavaScript disabled, consider rendering both images side by side by default and enhancing to a slider when JavaScript loads. This progressive-enhancement pattern guarantees the content is always visible and indexable, with the interactive slider as the upgrade. It requires structuring the section so the static layout and the slider layout share the same markup, which is slightly more work up front.

The image prep that makes or breaks it

The slider only convinces when the two images align. Shoot or select before-and-after pairs from the same angle, same distance, same lighting, and crop them to identical dimensions before upload. Even a slight perspective shift between the two images makes the divider reveal look wrong, and shoppers read that as the transformation being faked.

Keep file sizes sane. Two large images in one section can easily become the heaviest element on the page, so compress aggressively and serve responsive sizes. The slider should feel instant; if the after image visibly loads when the shopper first drags, the magic is gone.

Placing the slider for maximum impact

Where the slider sits on the page matters as much as how it is built. The highest-converting placement is directly under the product's main value proposition, close enough to the buy button that the transformation and the purchase decision happen in the same scroll. Buried halfway down a long page, even a perfect slider gets scrolled past.

On collection and landing pages, one slider beats three. Multiple sliders on the same page compete for attention and drag down performance, since each one loads an image pair. Pick the single most dramatic transformation, give it the full width it deserves, and let the rest of the page do its normal job. Restraint is what makes the one slider feel like proof instead of decoration.

The verdict

Use an app embed for a quick single-page win, build a custom section when the slider is core to the brand, and always prep aligned, compressed image pairs. Test the drag on a real phone, and the slider will do the selling for you.