Vertical Split Compare

(Draw the line)

Sketch above, printed below, same spread.

Pull the divider down to see how much of the first drawing survived contact with a press.

Spread of a printed editorial type specimen
Sketches and signage drafts pinned to a desk
SketchPrinted

Week three, pinned and argued over

Week eleven, off the press

About this block

Vertical Split ComparePRO

Comparison that splits horizontally instead of down the middle: a draggable divider wipes the upper photograph away to expose the lower one, with pill labels and a caption for each state.

Reveal8: Vertical Split Compare

The same comparison, split horizontally: one photograph above the divider, the other below, dragged up and down. Each state keeps its own pill label inside the frame and its own caption on the rule underneath.

Upgrade to Pro

Pro blocks install through the shadcn CLI with your license key and ship their full source. Docs and live previews stay open to everyone, so you can read every block's details first.

Upgrade Now

Installation

Swap YOUR_EMAIL and YOUR_KEY for the email and license key on your account. Find your license key on your account page.

Radix flavor

bash
npx shadcn add "https://ui.beste.co/r/reveal8?email=YOUR_EMAIL&license_key=YOUR_KEY"

Base UI flavor

bash
npx shadcn add "https://ui.beste.co/r-base/reveal8?email=YOUR_EMAIL&license_key=YOUR_KEY"

This installs the block to components/beste/block/reveal8.tsx plus the badge7 eyebrow it uses.

Quick start

The installed file exports reveal8Demo alongside the block: the exact props behind the preview above. Spread it to get a working comparison in one line.

tsx
import { Reveal8, reveal8Demo } from "@/components/beste/block/reveal8";

export default function Page() {
  return <Reveal8 {...reveal8Demo} />;
}

Then replace the demo with your own props. Written out, a trimmed setup looks like this:

tsx
import { Reveal8 } from "@/components/beste/block/reveal8";

export default function Page() {
  return (
    <Reveal8
      badge={{ label: "Draw the line" }}
      heading="Sketch above, printed below, same spread."
      description="Pull the divider down to see how much of the first drawing survived."
      startPosition={45}
      top={{
        src: "/case/sketch.jpg",
        alt: "Sketches pinned to a desk",
        label: "Sketch",
        caption: "Week three, pinned and argued over",
      }}
      bottom={{
        src: "/case/printed.jpg",
        alt: "Printed editorial spread",
        label: "Printed",
        caption: "Week eleven, off the press",
      }}
      labels={{ handleLabel: "Drag to compare" }}
    />
  );
}

Props

PropTypeDefaultDescription
badge{ label: string }–Eyebrow label rendered as a Badge7
headingstring–Section heading in the left header column
descriptionstring–Supporting paragraph in the right header column
topStackImage–The image revealed above the divider
bottomStackImage–The image revealed below the divider
startPositionnumber50Where the divider starts, as a percentage from the top
labelsReveal8Labels{}Fixed strings that are not content: the handle's accessible name
classNamestring–Extra classes for the outer <section>
ts
type StackImage = {
  src: string;
  alt: string;
  label: string;
  caption: string;
};

type Reveal8Labels = {
  handleLabel?: string;
};

Behavior notes

  • The reveal is a clip-path: inset() on the top layer rather than a height change, so neither photograph is ever squashed: both stay object-cover at full frame size while only the visible band changes.
  • Dragging works anywhere in the frame, not only on the handle: onPointerDown captures the pointer on the container, so a fast drag that leaves the box still tracks until release.
  • touch-none is set on the frame, which is what stops a vertical touch drag from scrolling the page instead of moving the divider.
  • The handle is a role="slider" button with aria-orientation="vertical" and a live aria-valuenow; up and down arrows nudge it in four percent steps, so the comparison is operable without a pointer.
  • Pill labels sit in opposite corners, top left and bottom left, so each one stays inside its own half at every divider position.
  • Captions live outside the picture on a shared border-t rule, one per side, with the second md:justify-self-end so the pair reads as a caption line rather than a paragraph.
  • The frame changes ratio rather than height (aspect-[4/3] becoming md:aspect-[16/9]), so a phone gets a taller box to drag through and a desktop gets a wide plate.

More Reveal blocks

View all Reveal
FREE

reveal2

Comparison Slider with Highlights

FREE

reveal1

Before/After Image Slider

PRO

reveal6

Drag Compare Slider

Get Pro access