Skip to content

Media & effectsLumen Halo

Image CompareProv1.0.0

Two images in one frame with a divider between them: drag anywhere or click to jump, or focus the handle and use the arrow keys. It's a slider, so it is named and says how much of each image shows.

Built on shadcn/ui

.md
pnpm dlx shadcn@latest add @beautiful-ui-pro/lumen-image-compare

Needs your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.

Styles didn't apply?

The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.

Set up the Beautiful UI registry

Free pieces install from their URL with no setup (that URL gives the Base UI build; Radix projects use /r/radix-nova/<name>.json, or add the registries below and the CLI picks your build). Pro pieces need the registries below and BEAUTIFUL_UI_TOKEN in .env.local.

components.json
{
  "registries": {
    "@beautiful-ui": "https://beautiful-ui.dev/r/{style}/{name}.json",
    "@beautiful-ui-pro": {
      "url": "https://beautiful-ui.dev/r/pro/{style}/{name}.json",
      "headers": { "Authorization": "Bearer ${BEAUTIFUL_UI_TOKEN}" }
    }
  }
}

MCP server

claude mcp add --transport http beautiful-ui https://beautiful-ui.dev/api/mcp
Catalog for agents: /llms.txt

Usage

Import it and pass your content. The props that matter most are listed next.

Example
"use client";

import { ImageCompare } from "@/components/ui/lumen/controls/image-compare";

export function GradeComparison() {
  return (
    <ImageCompare
      className="aspect-[3/2] w-full max-w-2xl"
      before={<img src="/photos/raw.jpg" alt="The photo as shot" />}
      after={<img src="/photos/graded.jpg" alt="The photo after grading" />}
    />
  );
}

Props

  • before / after–

    ReactNode

    The two images (img, picture, video, svg…). Give each its own alt text.

  • value / defaultValue / onValueChange50

    number / number / (value: number) => void

    How much of before shows, 0–100.

  • orientation"horizontal"

    "horizontal" | "vertical"

    A vertical divider moving sideways, or a horizontal one moving up and down.

  • step / largeStep1 / 10

    number

    Arrow key step, and Shift+arrow or Page Up/Down.

  • showLabelstrue

    boolean

    Before and After in the corners; each steps aside when the divider comes near.

  • labels–

    Partial<{ handle, before, after, valueText }>

    The words, for other languages.

Source

components/ui/lumen/controls/image-compare.tsx

This component is included with Pro.

Try the live preview above. Get Pro to install the source.