vibran

Image comparison slider

Portuguese name: Antes e depois

An image comparison slider that puts two images side by side behind a divider. Drag it with the mouse or a finger, or use the arrow keys, to compare before and after.

Preview of Image comparison slider running live
Copy the promptAdjust colors and speed

When to use it

Made for anyone selling a visible result: aesthetics clinics, dentists, renovations, upholstery cleaning, photo retouching. Both images need the same framing and size, or the divider exposes a crooked seam and the comparison falls flat. Use data-inicio to open the divider toward the after side when that is the selling point, and fill in data-rotulo for screen reader users.

How to add it to your site

  1. Copy the prompt in the gallery. It comes with the effect's name and the full code. The prompt text is written in Portuguese, and AI builders handle that fine.
  2. Paste it into your AI: Lovable, Claude, Cursor, Bolt or v0.
  3. Done: the AI adds the effect to your project, just like you saw it here.

Use it in HTML

The effect is plain JavaScript, no library. Just put the data-efeito attribute on the element:

<div data-efeito="antes-depois"><img src="antes.jpg" alt="Antes"><img src="depois.jpg" alt="Depois"></div>

More images effects

All 11 images effects →