Before after comparison

Image comparison with a draggable divider, driven by a native range input — so it also works with arrow keys and is announced properly to assistive technology. Up to three comparisons.

Merchant-addable
Yes
Settings
35
Block types
1
Max blocks
3
File
sections/before-after.liquid

Used by default on: Home

When to use it

Visible, honest transformations — texture, finish, fit, coverage.

Setting it up

  1. Add the section and write the heading and intro under Section content.
  2. Pick a Layout and set Comparison behavior — drag, hover, or reveal.
  3. For Carousel or Stacked, choose Content layout → Beside comparison to place the existing eyebrow, heading, and subheading to the left on desktop. Content stacks above below 990px. Above comparison is the default; Grid and Editorial always keep the introduction above.
  4. Optionally enter a Button label and Button link under Section content. The button appears only when both are filled, in either content layout.
  5. Set Content alignment for desktop and Mobile header alignment for screens below 750px. Both default to Center. Choose Follow desktop to reuse Content alignment on mobile. Heading size scales the subheading too.
  6. Add a Comparison block per pairing, with a before image, an after image, and captions.
  7. Match the two images exactly for framing, lighting, and crop. A comparison where the lighting changed is not a comparison.

Where the content comes from

Section settings own the introduction, content layout, and optional button. Comparison blocks own images, labels, captions, links, and ordering by default. Optional product metafields supply paired comparison images and captions in Product comparisons mode; manual blocks work without metafields.

Notes and cautions

  • Editorial centers the comparisons as a group on desktop, with a larger lead image and bottom-aligned supporting images. Extra width stays at the outer sides, keeping the gap between blocks consistent. On mobile, two comparisons share a 60/40 row; three show a full-width lead above an equal pair.
  • Before-and-after imagery invites overstated claims and is heavily scrutinized in regulated categories. Keep the pairings honest and the captions factual.
  • The divider is keyboard-operable, which most comparison sliders are not. Do not replace it with a mouse-only widget.

Place content beside a comparison

New sections start with a Carousel, Wide images, Above comparison content, a Medium heading, centered Content alignment and Mobile header alignment, and Reveal on scroll interaction. The default introduction is “Texture study”, “See how the finish changes”, and “Use the reveal to compare product texture and finish under consistent lighting.”

The preset includes two manual comparisons: Balm / Melted texture and Bare finish / Mineral SPF finish, with their explanatory captions and no product links or selected images. Placeholders let the preset work before images are chosen. Starter captions describe how to use the comparisons without naming a demo product. Existing demo instances retain their saved product-specific captions.

Other saved defaults are two product comparisons when using Product comparisons, two mobile columns when using Grid, horizontal divider orientation, a 50% starting position, visible labels, a Bar handle, a 1px divider, Scheme 6, entrance animation enabled, and 60px top and bottom padding. Images use the theme corner radius; the optional custom radius starts at 12px. The optional button and product picker start empty. Existing section instances keep their saved values.

Choose Layout → Carousel or Stacked, then set Content layout → Beside comparison. At desktop widths of 990px and above, the introduction sits on the left and the comparison sits on the right. Below 990px, content appears above the images in the same reading order.

The panel reuses Eyebrow, Heading, and Subheading under Section content. It does not repeat the introduction above the section. Content alignment controls the text alignment in either position on desktop, and aligns comparison labels and captions on every screen size. Choose Left for a conventional side panel or Center to center all comparison text. Labels beneath narrow images align within their respective half of the card. Mobile header alignment controls the introduction and its button below 750px. Choose Left, Center (the default), or Right independently, or use Follow desktop to reuse Content alignment. This mobile override applies only to the introduction and its button; comparison labels and captions continue to follow Content alignment. There is no separate Caption alignment control.

Heading size uses the theme’s compact scale: Small is 22px, Medium is 28px, and Large is 36px on desktop, reducing to 20px, 24px, and 28px below 750px. The same setting also scales the subheading. Small uses 14px supporting text on desktop and 15px on mobile, Medium uses 15px, and Large uses 16px. This keeps the body text subordinate to the heading while maintaining readable mobile text.

SettingBehavior
Content layout: Above comparisonDefault. Keeps the introduction above the comparison.
Content layout: Beside comparisonAvailable for Carousel and Stacked. Uses two columns on desktop and stacks on smaller screens.
Button labelOptional action text, such as “View product”. Leave blank to omit the button.
Button linkAppears when a button label is entered. Both label and link are required for the button to render.

Grid and Editorial retain the introduction above the comparisons. Switching to either layout ignores a previously saved Beside comparison selection. Clearing all introduction text and the button removes the content panel and lets the comparisons use the section width.

Editorial comparisons form a centered group with a larger lead image. Extra desktop width stays at the outside edges, preserving the gap between comparisons.

Wide images retain their 16:9 ratio in Carousel and Stacked layouts and are capped at 480px tall (approximately 853px wide). The comparisons stay centered with space at the sides on wider screens, keeping captions and navigation close to the image.

Carousel navigation uses an unboxed row of small arrows and pagination marks beneath the image. The active comparison has a short line indicator. Arrow buttons retain 44px tap targets, and keyboard focus remains visible.

Reveal on scroll makes one sweep using the global interface animation speed and easing. No motion and reduced-motion preferences disable the sweep and smooth carousel scrolling. Dragging and keyboard input interrupt the sweep immediately. Comparison sliders have unique labels that identify their Before and After pairings.

Captions wrap long unbroken text and use 15px text, including on mobile. Images use width hints capped to the comparison frame; first-section comparison images load eagerly with high fetch priority, while later sections load lazily.

When Show labels is enabled, cards up to 360px wide place Before and After labels in separate columns below the image. Longer labels wrap without overlapping or covering the divider. Wider cards retain image overlays, with each label limited to half the image width.

Section settings own the introduction, layout, and button. Comparison blocks own manually selected images, labels, captions, links, and ordering. They can be duplicated or reordered; the first comparison remains the lead in Editorial. Product comparisons can instead use the optional custom.before_images, custom.after_images, and custom.comparison_captions product metafields. Manual comparisons require no metafields.

Before after comparison design

100%

Use the zoom controls, then scroll to inspect the image. Press Escape to close.

Section settings

Every setting on the section itself, in the order it appears in the theme editor. Group headings match the editor's own grouping.

Section content

EyebrowText
ID
eyebrow
Default
Texture study
HeadingText
ID
heading
Default
See how the finish changes
Heading sizeDropdown
ID
heading_size
Default
Medium
  • Smallsmall
  • Mediummedium
  • Largelarge
SubheadingRich text
ID
subheading
Default
<p>Use the reveal to compare product texture and finish under consistent lighting.</p>
Content alignmentDropdown
ID
content_alignment
Default
Center
  • Leftleft
  • Centercenter
  • Rightright
Mobile header alignmentDropdown

Aligns the introduction and its button below 750px, separately from Content alignment.

ID
mobile_header_alignment
Default
Center
  • Follow desktopdesktop
  • Leftleft
  • Centercenter
  • Rightright
Button labelText
ID
button_label
Button linkLink
ID
button_link
Shown when
button_label is set

Comparisons

Comparison sourceDropdown

Comparison blocks show the same pairing on every page. Product comparisons read each product's own images and hide the section on products that have none.

ID
comparison_source
Default
Comparison blocks
  • Comparison blocksmanual
  • Product comparisonsproduct

Product comparisons read the product metafields custom.before_images and custom.after_images, and pair them in order. Keep both lists the same length and in the same order, because removing an image from one list shifts every pair after it and compares the wrong images. Up to three pairs render. Captions can come from custom.comparison_captions. Comparison blocks are ignored in this mode.

Comparisons shownSlider

The most pairs to render from the lists, in list order.

ID
comparison_limit
Default
2
Range
1 to 3, in steps of 1
Shown when
comparison_source is 'product'
ProductProduct

Used outside a product page. On product pages, the current product supplies the comparisons.

ID
fallback_product
Before labelText
ID
before_label
Default
Before
Shown when
comparison_source is 'product'
After labelText
ID
after_label
Default
After
Shown when
comparison_source is 'product'

Layout

LayoutDropdown
ID
layout
Default
Carousel
  • Gridgrid
  • Carouselcarousel
  • Stackedstacked
  • Editorialeditorial
Content layoutDropdown

For Carousel and Stacked layouts. Beside comparison places content on the left on desktop and above on mobile. Grid and Editorial keep content above.

ID
content_layout
Default
Above comparison
Shown when
layout is 'carousel' or layout is 'stacked'
  • Above comparisonabove
  • Beside comparisonbeside
Comparisons per row on mobileDropdown
ID
columns_mobile
Default
2 columns
Shown when
layout is 'grid'
  • 1 column1
  • 2 columns2
Image ratioDropdown
ID
image_ratio
Default
Wide
  • Portraitportrait
  • Squaresquare
  • Landscapelandscape
  • Widewide
Use custom corner radiusCheckbox
ID
use_custom_image_radius
Default
Off
Image corner radiusSlider
ID
image_radius
Default
12
Range
0px to 40px, in steps of 2px
Shown when
use_custom_image_radius

Comparison behavior

Divider orientationDropdown
ID
orientation
Default
Horizontal (drag left and right)
  • Horizontal (drag left and right)horizontal
  • Vertical (drag up and down)vertical
InteractionDropdown

Drag lets shoppers move the handle. Hover follows the cursor on desktop. Reveal plays a short automatic sweep the first time the comparison scrolls into view.

ID
interaction
Default
Reveal on scroll
  • Drag the handledrag
  • Follow the cursor on hoverhover
  • Reveal on scrollreveal
Starting divider positionSlider

Where the divider rests before the shopper moves it.

ID
start_position
Default
50
Range
0% to 100%, in steps of 5%
Show before and after labelsCheckbox
ID
show_labels
Default
On
Handle styleDropdown
ID
handle_style
Default
Bar
  • Circlecircle
  • Barbar
Divider thicknessSlider
ID
divider_thickness
Default
1
Range
1px to 6px, in steps of 1px

Style

Color schemeColor scheme
ID
color_scheme
Default
scheme-6
Show entrance animationCheckbox

Fades the section in on scroll. Respects the theme animation setting and reduced motion.

ID
enable_entrance_animation
Default
On

Section padding

Top paddingSlider
ID
padding_top
Default
60
Range
0px to 120px, in steps of 4px
Bottom paddingSlider
ID
padding_bottom
Default
60
Range
0px to 120px, in steps of 4px

Blocks

Blocks are added, reordered, duplicated, and removed inside the section. Each type has its own settings.

Comparison comparison

Before imageImage

For the clearest result, use two images with the same dimensions and framing. 1200 x 1200px .jpg recommended.

ID
before_image
Before labelText
ID
before_label
Default
Before
After imageImage
ID
after_image
After labelText
ID
after_label
Default
After
CaptionText

Optional line shown below the comparison, such as a product or treatment name.

ID
caption
Caption linkLink
ID
link