Comparator

Interactively compare two elements with a draggable slider to reveal differences.

Draggable sliderWorks with any elementCustomizable physics
Basic
Features

Any Element Support

Compare images, text, code blocks, or any React component.

Hover Interaction

Optional hover mode for desktop-friendly comparison.

Spring Physics

Smooth, natural motion with configurable spring settings.

Custom Slider

Fully customizable handle and separator line.

Installation
Works with npm, pnpm, yarn, and bun

$npx libravelui@latest add comparator

Anatomy
import { Comparator, ComparatorPane, ComparatorSlider } from "@/components/ui/motion/comparator";<Comparator><ComparatorPane position="left">  <BeforeComponent /></ComparatorPane><ComparatorPane position="right">  <AfterComponent /></ComparatorPane><ComparatorSlider /></Comparator>
Testing Playground
Non-Image Content
Hover Mode
Custom Slider
Props

Loading types…

Accessible React component library to copy, customize, and own your UI. Built for Next.js, Vite, and Laravel.

Crafted by dervyon. Peep the Source Code on GitHub.

Hosted on Vercel. The source code's got the MIT license.

2025 - 2026 · LibravelUI

Starter Kits

Templates

    Coming Soon

Labs