Image Compare

Prove the difference with a before-and-after slider.

A before / after image slider — drag, click or hover to compare, with handle designs, labels, frames, a hint animation and full keyboard support.

Gutenberg block

Requirements

  • The block editor (Gutenberg)
  • WordPress 6.5 or newer
  • PHP 7.4 or newer
  • Licence: Pro ($2 / year) — add it to the cart in Moduly

Add it to a page

  1. Open the page or post in the block editor.
  2. Click + (Block Inserter) and search for Image Compare — it is in the Moduly category.
  3. Insert it, then fill in its content on the canvas.
  4. Adjust it in the right sidebar: the Block tab holds the settings below, and the Styles tab its colours, typography and spacing.

Settings

Slider

SettingWhat you can set
Directionhorizontal or vertical
Starting position (%)0–100
Move the divider bydrag, handle, click or hover
Return to the start when the mouse leavesOn / off
Keyboard step (%)1–25
Hint animationnone, sweep, reveal or pulse
Screen-reader labelText

Images

SettingWhat you can set
Frameauto, height, 1/1, 16/9 or 4/5
Height (px)120–1000
Image focuscenter center, center top, center bottom, left center or right center
Before image looknone, grayscale, sepia, faded, blur, dark or invert
Tint the images on hoverOn / off

Handle

SettingWhat you can set
Designcircle, square, pill, arrows, line or knob
Inside the knobarrows, grip, text or none
WordText
Line thickness (px)1–20
Knob size (px)16–140
Knob scale on hover1–1.5

Labels

SettingWhat you can set
Show labelsalways, hover or never
Distance from the edge (px)0–80
Frosted glassOn / off
LineColour
KnobColour
Knob iconColour
Hover tintColour
Label backgroundColour
Label textColour

Frame shape

SettingWhat you can set
Corner radius (px)0–60

Styles tab: typography, spacing and shadow, from WordPress's own design tools.

Tips

  • Start with the Design choice — it changes the overall look the most; fine-tune the rest afterwards.
  • Visitors who ask their device for reduced motion get a calmer, still version automatically.

Troubleshooting

  • Pattern text is English only.
  • No Moduly loader change was needed.
  • A change not showing on the live site is almost always a page cache — clear your caching plugin or host cache.
  • Also available for Elementor (Image Compare).
  • Works well with: Carousel, Device Scroll, Filterable Gallery.