Ravi Katiyar

Image Comparison Slider (Horizontal)

Galleries 837

About

Horizontal Image Comparison Slider – Interactive before/after viewer. Allows users to compare two images with a draggable horizontal handle. Perfect for showcasing edits, retouching, or visual transformations in photography, design, or beauty apps.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Image Comparison Slider (Horizontal) to your project and fits it to your theme.

Code

How Image Comparison Slider (Horizontal) is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

// image-comparison-slider/demos/default/code.demo.tsx

import { ImageComparisonSlider } from "@/components/ui/image-comparison-slider-horizontal"; // Adjust the import path

export default function ImageComparisonSliderDemo() {
  return (
    <div className="w-full max-w-4xl mx-auto">
      <div className="rounded-lg border overflow-hidden aspect-[16/9]">
        <ImageComparisonSlider
          leftImage="https://cdn.21st.dev/assets/mirror/05/0556b3e0953faa718b15934a7aa515d98f2d94d2d497648f01a782b09625ce63.jpg"
          rightImage="https://cdn.21st.dev/assets/mirror/05/0556b3e0953faa718b15934a7aa515d98f2d94d2d497648f01a782b09625ce63.jpg"
          altLeft="A colorful mountain landscape at night"
          altRight="The same mountain landscape in black and white"
        />
      </div>
    </div>
  );
}

Dependencies

More by Ravi Katiyar

View all
  • Animated Shader Hero

    Animated Shader Hero

    3.8K
  • Hero

    Hero

    3.4K
  • Circular Gallery

    Circular Gallery

    3K
  • Minimalist Hero

    Minimalist Hero

    2.8K
  • Glass Calendar

    Glass Calendar

    2K
  • Floating Icons Hero Section

    Floating Icons Hero Section

    2K
  • Feature Carousel

    Feature Carousel

    1.8K
  • AI Image Generator Hero

    AI Image Generator Hero

    1.5K

More in Galleries

View all
  • Photo Deck

    Photo Deck

    49
  • Cylinder Tunnel Gallery

    Cylinder Tunnel Gallery

    7
  • Scattered About

    Scattered About

    54
  • Animated Gallery

    Animated Gallery

    1.6K
  • Phantom Infinite Gallery

    Phantom Infinite Gallery

    58
  • Gallery Component

    Gallery Component

    23
  • Image Gallery

    Image Gallery

    131
  • Hero Section 6

    Hero Section 6

    968