miladjoodi

Image Diff Slider

Text 3

About

A draggable before/after slider that reveals one image or content block over another to compare two versions side by side.

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

Code

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

Usage.tsx

import { Diff, DiffItem1, DiffItem2, DiffResizer } from "@/components/ui/diff";

export default function DiffText() {
  return (
    <div className="mx-auto w-full max-w-xl">
      <Diff className="aspect-video w-full rounded-lg">
        <DiffItem1>
          <div className="grid place-content-center bg-primary text-[clamp(2rem,12vw,6rem)] font-black text-primary-foreground">
            FARSIUI
          </div>
        </DiffItem1>
        <DiffItem2>
          <div className="grid place-content-center bg-muted text-[clamp(2rem,12vw,6rem)] font-black text-foreground">
            FARSIUI
          </div>
        </DiffItem2>
        <DiffResizer />
      </Diff>
    </div>
  );
}

Dependencies

More by miladjoodi

View all
  • Empty State

    Empty State

  • Avatar

    Avatar

  • Phone Input

    Phone Input

  • Button

    Button

  • Item

    Item

  • Signature Pad

    Signature Pad

  • Hover Card

    Hover Card

  • File Upload

    File Upload

More in Text

View all
  • Astryx Chat Tokenized Text

    Astryx Chat Tokenized Text

    16
  • Vertical Cut Reveal Characters

    Vertical Cut Reveal Characters

    135
  • Blur Reveal

    Blur Reveal

    401
  • Scroll Fill Headline

    Scroll Fill Headline

    67
  • Text Reveal

    Text Reveal

    411
  • Per Word Crossfade

    Per Word Crossfade

    20
  • Italic Sweep Scroll Text

    Italic Sweep Scroll Text

    77
  • Apple Hello Effect

    Apple Hello Effect

    692