Before / After Slider
Touch-friendly image comparison with a draggable handle.
Live preview
See it in action.
Fully interactive, drag, click, scroll inside the frame, toggle to mobile.
About this section
Conversion-grade before / after slider with native <input type='range'> for accessibility (keyboard, screen readers), aspect-ratio-locked container, and clip-path-driven reveal, all in vanilla JS.
Install in 90 seconds
- 01
Create /sections/modblo-before-after.liquid.
- 02
Paste the code and save.
- 03
Add the section, upload your before & after images.
The code
This is the file you'll paste into your theme.
Unlock the section code
Before / After Slider is a premium section. Get the full Liquid + scoped CSS paste-ready.
One-time purchase · Lifetime updates · You own the code
What you can customize
Every setting below shows up in the Shopify theme editor. Change them without touching code.
| Setting | Type | Default |
|---|---|---|
Heading heading | Text | , |
Subheading subheading | Long text | , |
Before image before_image | Image | , |
After image after_image | Image | , |
Before label before_label | Text | , |
After label after_label | Text | , |
Background bg | Color picker | , |
Foreground fg | Color picker | , |
Handle color handle_color | Color picker | , |
SEO and accessibility notes
- Real <input type='range'> means keyboard users can drag the divider with arrow keys.
- Both images include alt text. Container uses aspect-ratio so no CLS.
Related
