Documentation

Before / after section: compare two images with a slider

Show what your product does with two overlaid photos that customers compare by dragging a slider, on desktop and mobile.

The Before / after section overlays two photos taken from the same angle. The customer drags the slider to reveal one or the other: it's the most convincing proof for skincare, makeup, a cleaner, a lamp or a renovation. It fits on the home page, a launch page or below a product page.

The Before / after section on the Sylys demo: a bare eyebrow on the left, the same one after the pencil on the right, the slider in the middle and a text with a button beside it
The Before / after section on the Sylys demo: a bare eyebrow on the left, the same one after the pencil on the right, the slider in the middle and a text with a button beside it

The presets

Before / after

A centered heading above two comparison sliders side by side. Ideal to show two results, or the same product on two people. On mobile, the two sliders stack.

The Before / after preset: the heading "See the difference" above two portrait comparison sliders
The Before / after preset: the heading "See the difference" above two portrait comparison sliders
The Before / after preset on mobile: the two sliders one below the other
The Before / after preset on mobile: the two sliders one below the other

Transformation

A square comparison slider on the left, and on the right a heading, a text, a bulleted checklist and a Shop now button. This is the preset to choose for selling: the image proves, the text explains, the button leads to the product.

The Transformation preset: a square slider on the left, a heading, a text, three checked selling points and a button on the right
The Transformation preset: a square slider on the left, a heading, a text, three checked selling points and a button on the right

On mobile, the text moves below the image:

The Transformation preset on mobile: the slider at the top, the text, the list and the button below
The Transformation preset on mobile: the slider at the top, the text, the list and the button below

A full-width example

The Lumyx demo uses a single full-width slider, with custom labels ("Ceiling light" and "Halo on") and a slider in the brand's colors:

The Lumyx demo slider: the same desk lit by a ceiling light on the left and by the light bars on the right, turquoise slider
The Lumyx demo slider: the same desk lit by a ceiling light on the left and by the light bars on the right, turquoise slider

Add the section

  1. In your Shopify admin, open Online Store > Themes and click Edit theme.
  2. Choose the template from the menu at the top (for example Home page).
  3. Click Add section, open the Media category and choose Before / after or Transformation.
  4. Click the Before / after block and choose the Image before and Image after.
  5. Click Save.
Screenshot to take — Shopify theme editor > Home page > Add section > Media category: Before / after and Transformation presets visible

The section's blocks

BlockWhat it's for
Before / afterThe comparison slider: the two images, the labels, the handle.
Heading, Text, Checklist, Button, GroupThe content around the slider (included in the presets, freely editable).

The Before / after block

  • Image before and Image after. Use the same framing: with Adapt to image, the frame takes the shape of the Before image and the After image is cropped to fit it.
  • Labels group: Before and After (the label text, for example "Bare brow" and "After the pencil"), Position (Top or Bottom).
  • Layout group:
    • Direction: Horizontal (handle slides left to right) or Vertical (top to bottom);
    • Image height: Adapt to image, Small, Medium, Large, Square, Portrait or Landscape;
    • Start position: where the handle sits when the page loads, 50% by default;
    • Move the handle when it comes into view: the handle moves once to show it can be dragged;
    • Corner radius and Bottom spacing.
  • Design group: check Customize colors to choose the Divider color, the Handle background and the Arrows color. Otherwise, the handle follows the theme's style (white).
The comparison slider up close, with its Before and After labels at the top and the round handle in the center
The comparison slider up close, with its Before and After labels at the top and the round handle in the center

The section settings

The section only has the frame shared by almost every section in the theme: Layout (width, direction, spacing), Color palette, Separators and Animations. It's explained in Understand the theme editor.

Tips and pitfalls

  • Take both photos in the same place, with the same lighting and framing. Otherwise the customer sees the difference between the photos, not the product's effect.
  • Export both images at the same size: with Adapt to image, the After image is cropped to the shape of the Before image.
  • Leave Move the handle when it comes into view checked on at least one slider: many visitors don't guess that it can be dragged.
  • Be honest: no retouching on the After image. A believable comparison sells better than a spectacular one.
  • Concrete labels ("Day 1" / "Day 28", "Ceiling light" / "Halo on") say more than "Before" and "After".

Learn more