Shopify sections
Before/after image slider for Shopify product pages
A Shopify before after slider stacks two photos of the same subject in one frame, and the shopper drags a divider across them to reveal more of the before or the after image. The Before/After section in Section Store builds this for Online Store 2.0 themes and is free. It offers four handle styles, seven desktop aspect ratios and works by touch, mouse and keyboard.
- One image pair per instance, uploaded in the app builder
- Placed in the main product section through the Section Store app block
- Phone aspect ratio set separately from the desktop one
Last checked:

When to use it
Use it when the change is visible in one matching photo pair
Use it when
- The product changes how something looksSkincare, cleaning products, renovation work, photo presets and repairs produce a result the shopper can see. The slider puts that result under the shopper's finger instead of in a claim. Rename Before Label and After Label to the actual states, for example "Untreated" and "Treated".
- Both photos share angle and framingThe upper image is cut at the divider, so any shift in zoom, horizon or position shows as a break along the line the shopper drags across. Shoot both from the same spot with the same crop, then upload them as Before Image and After Image.
- The comparison belongs on the product pageThe app proposes the section as a block in the main product section, next to the product it explains. The divider follows touch and mouse drags, so the comparison does not depend on hover and works the same on phones.
- Landscape photos on desktop, portrait on phonesAspect Ratio defaults to Widescreen (16:9), while Aspect Ratio (Mobile) defaults to Portrait (4:5) and is set on its own. A wide desktop frame therefore does not shrink to a thin strip on a phone. Pick Same as desktop if your photos are already square or portrait.
Skip it when
- Photos differ in angle or lightingThe slider then shows the change in photography, not the result of the product. Reshoot the pair, or show the two photos side by side in the product gallery where they read as two separate pictures.
- The result is a numberA measured reduction or a runtime has no picture to drag across. Use a stats section that shows the figure and its unit.
- Feature-by-feature comparison with a competitorA slider compares two images, not rows of attributes. Use a comparison table with one column per product and one row per feature.
In detail
Starting position, divider colour and label background decide whether the comparison reads
The shopper sees one frame with both photos stacked and a divider on top. Dragging it by touch or mouse shows more of one image and less of the other. The divider can also be moved from the keyboard, the section is screen-reader friendly and it honours prefers-reduced-motion. Most settings only change the look; three of them decide whether the shopper actually sees the difference.
Initial Position: leave it at 50 % when the change covers the whole photo, such as a repainted wall. When the change sits in one area, such as a scratch near one edge of a car door, move the start so the divider rests next to that area. The first drag then crosses the part that changed instead of an unchanged background.
Slider Color: the default is white. On bright subjects such as clean white tiles or a pale skin tone, a white line and handle fade into the photo and the shopper does not see what to grab. Pick a dark colour there. Minimal Line is the plainest of the four handle styles, so it needs that contrast more than Circle, Arrows or Square.
Label Background: Glass lets the photo show through the label. On a busy photo, such as a cluttered room or a patterned fabric, switch to Dark or Light so the label text stays readable. If the important part of the subject sits at the top of the frame, a face for example, move Label Position to Bottom so the labels do not cover it.
Image Fit: Fill (Crop if needed) trims both photos to the frame, Fit (Show entire image) shows the whole photo and fills the rest with Background Color. That colour is black by default, which shows as dark bands on a light product page; set it to the page background when you use Fit.
Two ways
Check your theme first, then build it by hand or add it with the app
Some themes ship their own before/after or image comparison section. Open the theme editor on the product template, add a section or block and look through the list before you install anything. If your theme has none, these are the two ways.
Way 1
By hand in theme code
Untested outline, not a finished listing. Clipping the image is the small part; the handle, the labels and right-to-left layouts take the time.
- Create a section or block file in the theme with two image settings and two label texts.
- Stack both images in one container with a fixed aspect ratio.
- Clip the upper image with clip-path driven by a CSS custom property.
- Lay a transparent input type=range over the images and update the property on input.
- Draw the line and handle so they follow the range thumb without blocking it.
- Give the range an accessible label and mirror the direction for right-to-left languages.
- Check on a phone that vertical page scrolling still works when a finger starts on the slider.
Choose this if: You maintain the theme code anyway, want the slider inside the theme's own settings, or need behaviour this section does not have, such as reading the image pair from a product metafield so every product shows its own photos.
Way 2
With the Section Store app
No theme code. Needs an Online Store 2.0 theme with app blocks. Before/After needs no purchase on any plan.
- Open Before/After in the Section Store builder.
- Upload the before and after images, then set labels, handle and both aspect ratios.
- Check the desktop, tablet and mobile preview and click Save.
- Click Install in theme; the theme editor opens with the Section Store app block on the product template.
- Confirm Before/After is selected in the block's section picker and save the theme.
Choose this if: You want the slider on the product page without editing theme files, and one image pair per placement is enough.
Builder settings
Every builder setting of Before/After
Set Before Image and After Image first, then Aspect Ratio (Mobile) and Image Fit: the defaults crop to Widescreen (16:9) on desktop and Portrait (4:5) on phones, which cuts into photos shot in other proportions. All of these live in the Section Store builder; the theme editor only shows the app block with its section picker, padding, max width and the hide on mobile and hide on desktop toggles.
Heading3
- Eyebrow
- Text
- DefaultEmpty
- Heading
- Text
- DefaultSee the difference
- Text Below Heading
- Text
- DefaultDrag the slider to compare before and after.
Images5
- Before Image
- File
- DefaultNone
- After Image
- File
- DefaultNone
- Show Labels
- On / off
- DefaultOn
- Before LabelConditional
- Text
- DefaultBefore
- After LabelConditional
- Text
- DefaultAfter
Slider5
- Initial Position
- Slider, 10–90 %
- Default50 %
- Slider Color
- Colour
- Default#ffffff
- Line Width
- Slider, 0–5 px
- Default2 px
- Handle Size
- Slider, 8–60 px
- Default48 px
- Handle Style
- Choice: Circle, Arrows, Square, Minimal Line
- DefaultCircle
Layout7
- Aspect Ratio
- Choice of 7, for example Square (1:1); Classic (4:3); Widescreen (16:9)
- DefaultWidescreen (16:9)
- Aspect Ratio (Mobile)
- Choice: Same as desktop, Square (1:1), Portrait (4:5), Portrait (3:4), Tall (9:16)
- DefaultPortrait (4:5)
- Custom Ratio (Height %)Conditional
- Slider, 25–200 %
- Default56.25 %
- Image Fit
- Choice: Fill (Crop if needed), Fit (Show entire image)
- DefaultFill (Crop if needed)
- Background ColorConditional
- Colour
- Default#000000
- Max Width
- Slider, 50–100 %
- Default100 %
- Border Radius
- Slider, 0–50 px
- Default16 px
Label Style4
- Label PositionConditional
- Choice: Top, Bottom, Middle
- DefaultTop
- Label BackgroundConditional
- Choice: Glass, Dark, Light, No Background
- DefaultGlass
- Font SizeConditional
- Size per device, 5–40 px
- Default13 / 13 / 12 px
- Font WeightConditional
- Choice: Normal, Medium, Semi Bold, Bold
- DefaultMedium
Effects2
- Show Shadow
- On / off
- DefaultOn
- Shadow IntensityConditional
- Choice: Light, Medium, Strong
- DefaultMedium
Spacing1
- Section Spacing
- Spacing per device
- DefaultTop padding 56 / 48 / 40 px
27 settings in 7 groups. These are settings in the Section Store builder, not theme editor settings: read from the app's section configuration, as of 2 Dec 2026. "Conditional" settings appear only once a related setting turns them on.
FAQ
Questions merchants ask about before/after sliders on Shopify
Not from one block on a shared template. The images are files set in the builder, so every product using that template shows the same pair. Create an alternate product template in the theme editor, place a separate instance there and assign the template to the products in the Shopify admin. A section can exist up to 20 times with different settings, so this suits a handful of products, not a whole catalogue.
Export both files at the same pixel dimensions from the same crop. With Fill (Crop if needed), each photo is trimmed to the frame on its own, so two files with different sizes or proportions are cropped differently and the subject jumps at the divider. Matching files line up on desktop and on the separate phone ratio.
The default output of the section is 10.9 KB, of which 4.3 KB is JavaScript and 4.5 KB is CSS. Both images load lazily. The two photos you upload add their own file size on top, so export them at the size the frame displays.
Yes. The product page is only where the app proposes to place it, not a technical restriction. Open that template in the theme editor, add the Section Store app block and pick Before/After in its picker. A shop can hold up to 100 section instances in total.
Yes. Texts such as the heading, Before Label and After Label can be translated per shop language in the builder. There is no machine translation, so each language is entered by hand.
Related
Related sections and pages
Before/After is free in Section Store.
Set it up in the app builder and place it through the Section Store app block. No theme code.
Sources
Sources
- Section Store app: builder configuration and generated code of Before/After · as of 2026-12-02
- Section Store on the Shopify App Store · as of 2026-12-02
- Shopify developer documentation: Sections