Set up Reveal Image Comparison
What you need
A HubSpot account with access to custom modules in the website, landing-page or blog-post editor you use. Permissions and subscription requirements depend on the content type. No external hosting, API key, third-party account, serverless function or database is needed.
Add your images
- Add Reveal Image Comparison to a supported editable area in your HubSpot page or blog post.
- In Content → Comparison images, choose a before image and an after image from your File Manager.
- Supply meaningful alternative text for both images. Describe what changes, rather than writing only “before” and “after.”
- Use images you own or are licensed to redistribute. For a convincing comparison, use matching dimensions, crops, subject alignment and camera position.
- Set each image's alignment if the subject is not centered. The two images share one comparison frame.
If either image is missing, the module shows a configuration placeholder instead of a broken slider. The downloadable source contains an original AI-generated demonstration pair; those images are not loaded by the module unless you explicitly select them. They do not depict a client project or a verified renovation outcome.
Choose the presentation
Under Interaction, set the divider orientation:
- Left and right images: a vertical divider reveals the before image from the left.
- Top and bottom images: a horizontal divider reveals the before image from the top.
The initial before-image visibility accepts 0–100%. Zero shows the after image; 100 shows the before image. Choose an aspect ratio that suits the images. Fill the area may crop edges; Fit the full image preserves the whole image and may leave empty space around it. Set the image-canvas background in Styles for this empty space.
Optional labels identify the two states. The on-image labels hide near the endpoints when their image is almost fully concealed. The accessible range value continues to identify both states. You can also show or hide the before/after/reset buttons.
Mouse, touch and keyboard
Drag or tap the image to move the divider. Horizontal comparison permits vertical page scrolling on touch devices. Vertical comparison uses vertical gestures inside its image area; scroll outside the image when necessary.
A native keyboard slider appears below the images in both orientations. It always runs left to right, even on RTL pages:
- Right/Up increases the before image by 1 percentage point.
- Left/Down decreases it by 1 percentage point.
- Hold Shift for 10-point arrow steps.
- Page Up/Page Down changes by 10 points.
- Home shows the after image; End shows the before image.
The labels and instructions are editable. Keep the {before}, {after}, {before_label} and {after_label} tokens in the accessible value pattern when translating. No autoplay or automatic sliding is used.
Style it in HubSpot
Use Styles to adjust heading/body font families, text colors, module and canvas backgrounds, label colors, control colors, divider color, border, corner radius, padding and maximum width.
Primary/secondary control colors and heading/body fonts inherit compatible theme fields where available, with built-in fallbacks. External font loading is disabled; select a system font or a font already loaded by your theme. Check text, button, grip and focus contrast after changing theme colors. Always test the published page at mobile widths after making design changes.
Multiple instances and fallbacks
Every comparison instance has its own position, labels and controls. You can use horizontal and vertical comparisons on the same page.
Both images remain visible in a static comparison if JavaScript is unavailable. Interactive controls appear only after both images have loaded. If an image fails to load, the module disables its controls, shows a message, and returns to the static image layout. The available image and descriptive alt text remain accessible.
Performance and privacy
Optimize large images before uploading. Match the image size to the display size; excessively large originals still use visitor bandwidth. You can choose lazy loading for comparisons further down a page or eager loading for an above-the-fold comparison. The module adds no image-processing service or new runtime library.
The module does not send comparison positions to an API, create tracking events, collect form data, or use cookies or browser storage. Image URLs selected in the editor are fetched by the visitor's browser. Select HubSpot-hosted File Manager assets if you want to avoid third-party image requests. Website analytics, chat widgets and consent tools installed separately on the page are governed by the site's own settings and policies.
Troubleshooting
- Configuration message: select both images in Content.
- Loading message remains: check that both URLs are available to public visitors and not restricted to signed-in users.
- Image error: check file permissions and the URL; replace deleted or inaccessible images.
- Images do not align: use matching camera angles and crops, then review image alignment and fit.
- Image appears cropped: use a matching aspect ratio or choose Fit the full image.
- No divider or controls: confirm JavaScript is enabled, both images have loaded, and the module's JavaScript is not blocked.
- Module is missing from the editor: check the page's editable areas, content type and your permissions.
Updates and removal
Test updates on a duplicate page first. Update the existing module folder rather than deleting and recreating the module. Review pages with custom labels, unusual image sizes and changed theme colors.
To remove it, delete the module instance from the page and publish that page. No remote user records, subscriptions or databases need cleanup. Demo images remain in File Manager until you remove them separately.
Support
Email kpanhar6@gmail.com with the page URL, browser and a description of the problem. Do not send personal access keys, passwords or confidential images.