Throttle Builder · Components · Basic

Before and after

Two images with a slider to compare them. Shown side by side without JavaScript.

The Before and after component in the Components library, with its description and settings
The Before and after component in the Components library, with its description and settings

What it is for

Two images with a slider to compare them, for repairs, edits or results.

Where you can use it

On any page, template, saved section, header or footer.

In the editor, open the Add tab of the left panel and drag it into a column. Its type is basic.before-after, version 1.

Options

Content tab

OptionKeyAllowed valuesDefault
Before imagebeforeAn image from the Media library.Empty
After imageafterAn image from the Media library.Empty
Before alt textbeforeAltText, up to 300 characters. One value per language.Empty
After alt textafterAltText, up to 300 characters. One value per language.Empty
Before labelbeforeLabelText, up to 60 characters. One value per language.“Before”
After labelafterLabelText, up to 60 characters. One value per language.“After”
Start position (%)startA number from 0 to 100.50
OrientationorientationHorizontal (horizontal), Vertical (vertical).Horizontal (horizontal)
ShaperatioAuto (auto), 1:1 (1:1), 4:3 (4:3), 3:2 (3:2), 16:9 (16:9).Auto (auto)
Slider name (for screen readers)handleLabelText, up to 100 characters. One value per language.“Comparison slider”
Load first (the main image of the page)priorityOn or off.Off

Style tab

OptionKeyAllowed valuesDefault
Handle colourhandleColorA theme colour (token:name) or a hex colour (#rrggbb or #rrggbbaa).Empty

Every component also has the common options: Hide, Anchor, Space above, Space below, Entrance animation and Entrance delay.

Responsive behaviour

Every option can be set again for tablet (768 to 1024 px) and phone (767 px and below): switch the device at the top of the editor and change it there. Tablet starts from the desktop value and phone from the tablet value, so you only set what differs.

The space is reserved from the shape you choose (Auto uses the shape of the Before image), on every device.

SEO and accessibility

Both images are written on the server with their alt text and labels. Without JavaScript they show side by side. With JavaScript the handle is a range input you can move with the arrow keys, Home and End.

With an AI agent

An agent adds it with add_widget and changes its options with update_node, using the keys above. See the MCP tool reference.

The widget an agent adds
{
  "type": "basic.before-after",
  "v": 1,
  "props": {}
}
Generated from the code
The option tables on this page are generated from the component definitions in @usethrottle/builder-schema 0.4.2 and @usethrottle/storefront-react 0.4.5.