Before After Image Slider

Compare two images with a draggable divider. Works in any HubSpot theme, with every colour, font and size editable from the Styles tab.

1. Add the module to a page

  1. Open a page, blog post or blog listing in the HubSpot editor.
  2. Click Add, search for Before After Image Slider and drag it into a section.
  3. Choose your Before image and After image in the Content tab. Until both are chosen, a demo illustration is shown.

Use two images with the same size and framing (for example two photos taken from the same spot). If they differ, choose an Image shape in Styles › Layout so both are cropped to the same frame.

2. Content tab

GroupFieldWhat it does
Heading and textEyebrow, Heading, Heading level, DescriptionOptional text shown with the slider. Leave everything empty to show only the images.
ImagesBefore image, After image, CaptionThe two images and their alt text. The caption appears under the images.
LabelsShow labels, Before label, After labelSmall tags on each side. Write them in your page language.
Slider behaviourDirectionHorizontal (left and right) or vertical (top and bottom).
Starting positionShare of the before image visible when the page loads.
InteractionDrag the handle or click anywhere, or follow the mouse pointer. Touch screens always drag.
Keyboard step, Accessible slider nameHow far each arrow key moves the handle, and the name read by screen readers.

3. Styles tab

GroupOptions
TextEyebrow, heading and description fonts, text alignment, eyebrow colour. Empty fonts use your theme fonts.
BackgroundBackground colour of the whole module (transparent by default).
BorderWidth and colour of the border around the images.
CornerCorner radius of the images and of the module.
SpacingPadding and margin, and the space between the text and the images.
LayoutText position (above, below, left, right), text column width, maximum width, alignment, image shape (same as the after image, 16:9, 3:2, 4:3, square, 21:9, 4:5) and image fit.
Divider and handleDivider colour and width, handle shape (circle, rounded square, pill, line only), size, colour, icon (arrows, chevrons, grip lines, none), automatic icon contrast and shadow.
LabelsFont, position (top, bottom, middle), background and text colours for each label, automatic text contrast, corner radius and capitals.
CaptionCaption font and colour.
AnimationHint movement when the slider first appears, and smooth movement on click.

The handle colour and the after label start with the primary colour of your HubSpot brand kit (Settings › Brand). Change them in the Styles tab to break the link.

4. Accessibility

5. Several sliders on one page

Add as many as you need. Each one has its own settings and works independently.

6. Troubleshooting

The two images do not line up

Export both images with the same size, or choose a fixed image shape with Fill the frame.

The handle is hard to see

Turn on the shadow, increase the handle size or pick a handle colour that contrasts with your images.

The text is too wide beside the images

Adjust Text column width in Styles › Layout. Below 768 px the text always moves above the images.

Support

Email support@digitalmakers.cat. We answer in English, Spanish and Catalan.