> For the complete documentation index, see [llms.txt](https://staylime.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://staylime.com/docs/avante-themes/sections/media/image-comparison.md).

# Image comparison

Before/after image slider in the Avante Shopify theme — two images, a draggable handle, and separate desktop and mobile artwork.

Image comparison is a before/after slider: two images stacked in the same frame with a handle the customer drags across to reveal one over the other. It is the fastest way to show a difference that a product description struggles with — skincare results, a restored piece of furniture, a room before and after a paint colour, a filter applied and removed.

The interaction itself does the selling, so it works best with a single, obvious change between the two images.

{% hint style="info" %}
**Theme Editor → Add section → Image comparison**
{% endhint %}

***

### How to add

{% stepper %}
{% step %}

### Add the section

In the Theme Editor, click **Add section** and choose **Image comparison**.
{% endstep %}

{% step %}

### Upload both images

The section takes two blocks. The first block is the "before" state, the second is "after". Each block has its own **Desktop image** and **Mobile image** fields.
{% endstep %}

{% step %}

### Set the height

Choose a **Height** mode — Adapt to image, Percent of screen, or a fixed pixel height — and check the result on both desktop and mobile.
{% endstep %}
{% endstepper %}

***

### Good to know

**The section can look fine in the editor and render nothing on the live page.** It only outputs when at least one block has an image — but the Theme Editor is exempt from that check, so placeholders appear there regardless. If the section is visible while you are editing and missing on the storefront, the images were never uploaded.

**Two blocks maximum.** It is a comparison, not a gallery; **Add block** stops after the second one.

**Height defaults to a share of the screen, not to the image.** Out of the box the section uses **Percent of screen** at 70% on desktop and 50% on mobile, which means tall or wide images get cropped to fit that band. Switch **Height** to **Adapt to image** if you want the full frame.

**Adapt uses the first block's image only.** In Adapt mode the section takes its aspect ratio from the first block — the desktop image, falling back to that block's mobile image. If the second block has a different shape it is cropped to match, so upload both images at the same dimensions.

**The handle is a real slider.** It is a range input, so it can be moved with the arrow keys as well as dragged, and it starts at the midpoint.

**Desktop and mobile images are separate fields.** A wide before/after that works on desktop usually needs a squarer crop on phones — fill in both, or the desktop crop is what mobile gets.

**Image comparison cannot be added to a section group.** It is disabled in the header, footer and overlay groups.

***

### Customization ideas

**Shoot from a tripod.** The effect falls apart if the camera moved between the two shots — identical framing is what makes the slider read as one image changing rather than two images swapping.

**Use it for configuration, not just results.** Two finishes of the same product, two colourways, or the same room with and without a piece of furniture all work as well as a before/after.

**Pair it with the product section.** Placed directly under the product details on a product template, a comparison answers "what will this actually do" at the moment the customer is deciding.

***

### Related

* [Media overview](https://staylime.com/docs/avante-themes/sections/media.md)
* [Media with text](https://staylime.com/docs/avante-themes/sections/media/media-with-text.md)
* [Image grid](https://staylime.com/docs/avante-themes/sections/media/image-grid.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://staylime.com/docs/avante-themes/sections/media/image-comparison.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
