Let your visitors compare images and make your website interactive — a standalone Gutenberg block plugin by WPDeveloper, part of the Essential Blocks family.
Image Comparison adds a before/after slider to the WordPress block editor. Drop in two images, then control the slider handle, orientation, hover behaviour, labels, colors and spacing from the block sidebar. Handy for WooCommerce stores, portfolios, and any before/after showcase.
The front-end slider is powered by react-compare-image.
- Completely customizable — images, size, colors, labels, and typography
- Vertical & horizontal comparison modes
- Slider on hover or drag-to-compare
- Super light-weight — no extra resources, optimized for fast loading and instant live editing
- Native block editor experience — full inspector controls with responsive settings
| Minimum | Tested up to | |
|---|---|---|
| WordPress | 6.0 | 7.1 |
| PHP | 7.4 | 8.5 |
- Open the WordPress Block (Gutenberg) editor
- Search for Image Comparison
- Install in one click
- Upload
image-comparisonto/wp-content/plugins/ - Activate the plugin through the Plugins menu in WordPress
- Follow the documentation
This repository uses two git submodules. Clone with them, or the build and the plugin will both be incomplete:
git clone --recurse-submodules git@github.com:EssentialBlocks/image-comparison.git
# already cloned?
git submodule update --init --recursive| Submodule | Path | Purpose |
|---|---|---|
controls | controls/ | Shared Essential Blocks inspector controls |
style-handler | lib/style-handler/ | Front-end CSS generation |
Install dependencies and build:
npm install # install dependencies
npm run start # development build with watch
npm run build # production build
npm run lint:js # lint JavaScript
npm run lint:css # lint styles
npm run format:js # format sourceBuilt with @wordpress/scripts. webpack.config.js builds two entries — dist/index.js (editor) and dist/frontend/index.js (front end) — plus dist/style.css.
CleanWebpackPlugin is filtered out of the config on purpose: dist/controls.js and dist/controls.css are vendored artifacts produced by the central Essential Blocks pipeline, not by this repository's build. Deleting dist/ removes them with no way to regenerate them here.
Source lives in src/, shared controls in controls/, and the PHP entry point is image-comparison.php.
Zips are produced with wp dist-archive, which honours .distignore:
wp package install wp-cli/dist-archive-command # once
wp dist-archive . ../image-comparison.zip| Branch | Purpose |
|---|---|
master | Stable, released code. Default branch. |
latest | Staging for the next release. |
dev | Active development. Open pull requests against this branch. |
Issues and pull requests are welcome at EssentialBlocks/image-comparison. Please branch off dev and target dev with your pull request.
GPL-3.0-or-later — see the licence text.