Search

Search components and flows across the catalog

ThatDesignUIOriginalInteractive preview

Before / after slider

Drag, touch or use arrow keys to reveal one design over another, from wireframe to finished UI.

Category
Sliders
Platform
Responsive

Interactive componentClick through it, resize it, or switch states. It’s real UI, not a screenshot.

Use this component

Free to use. It works on its own in any React and Tailwind project, so you can add it with one command, paste the code, or hand the prompt to your coding agent.

FreeReact 18+Tailwind v3.4 or v4No extra packages

1. Add it with the shadcn CLI

npx shadcn@latest add https://www.thatdesignui.com/r/compare-slider.json

2. Use it

Every prop is optional
app/page.tsx
import CompareSlider from "@/components/compare-slider";

export default function Page() {
  return <CompareSlider />;
}

Prefer to paste it yourself? Open the .

Under the hood

How it’s built

What’s inside

  1. A 16:10 rounded frame with a soft shadow that holds two layers of the same page: a grey wireframe on the left and the finished, coloured design on the right.
  2. A thin white divider with a round handle (arrows inside) sits at the split; the wireframe is revealed with a clip-path as it moves.
  3. Below the frame, a legend names the two sides with a grey dot and an indigo dot.

How it behaves

  • Dragging anywhere in the frame (mouse, touch, pen) moves the divider.
  • With the handle focused, Left/Right move 2%, Shift+Left/Right move 10%, Home and End jump to the ends.
  • The handle is a slider with aria-valuenow updating as it moves.
  • Touch dragging does not scroll the page sideways.

More from ThatDesignUI

Image gallery lightbox

Image gallery lightbox

ThatDesignUIOriginalMedia component

Notification center

Notification center

ThatDesignUIOriginalNotifications component

Interactive chart card

Interactive chart card

ThatDesignUIOriginalDashboard component

Multi-select combobox

Multi-select combobox

ThatDesignUIOriginalForms component