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.
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.
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
npx shadcn add "https://ui.beste.co/r/reveal8?email=YOUR_EMAIL&license_key=YOUR_KEY"Base UI flavor
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.
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.
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:
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" }}
/>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
badge | { label: string } | – | Eyebrow label rendered as a Badge7 |
heading | string | – | Section heading in the left header column |
description | string | – | Supporting paragraph in the right header column |
top | StackImage | – | The image revealed above the divider |
bottom | StackImage | – | The image revealed below the divider |
startPosition | number | 50 | Where the divider starts, as a percentage from the top |
labels | Reveal8Labels | {} | Fixed strings that are not content: the handle's accessible name |
className | string | – | Extra classes for the outer <section> |
type StackImage = {
src: string;
alt: string;
label: string;
caption: string;
};
type Reveal8Labels = {
handleLabel?: string;
};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.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.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.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.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.reveal1
Interactive image comparison component with a draggable divider supporting horizontal and vertical orientations. Perfect for showcasing transformations, photo editing results, or design improvements.
reveal2
Split-layout image comparison with a sidebar featuring benefit highlights and icons alongside a draggable before/after slider. Perfect for demonstrating product improvements with detailed feature callouts.
reveal6
Before and after comparison where a pointer-driven handle clips the earlier photograph over the later one, with pill labels on both corners and a ruled row of outcome figures beneath.
reveal11
Comparison that lifts diagonally instead of wiping straight: dragging the corner handle shrinks a triangular clip on the covering photograph to expose the one underneath, with notes on what changed.