Before and after comparison that plays itself: the seam walks from edge to edge on a timer, clicking the picture freezes it at that point, and a single round control resumes or holds the sweep between the two captions.
A comparison that plays itself: the seam walks from edge to edge and turns around, and clicking anywhere on the picture freezes it exactly where you want to look. One round control between the two captions puts the sweep back on.
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/reveal10?email=YOUR_EMAIL&license_key=YOUR_KEY"Base UI flavor
npx shadcn add "https://ui.beste.co/r-base/reveal10?email=YOUR_EMAIL&license_key=YOUR_KEY"This installs the block to components/beste/block/reveal10.tsx plus the badge7 eyebrow it uses.
The installed file exports reveal10Demo alongside the block: the exact props behind the preview above. Spread it to get a working comparison in one line.
import { Reveal10, reveal10Demo } from "@/components/beste/block/reveal10";
export default function Page() {
return <Reveal10 {...reveal10Demo} />;
}Then replace the demo with your own props. Written out, a trimmed setup looks like this:
import { Reveal10 } from "@/components/beste/block/reveal10";
export default function Page() {
return (
<Reveal10
badge={{ label: "Wipe it across" }}
heading="The shelf redesigns itself while you watch."
description="The seam sweeps on its own. Click the picture to stop it."
duration={7}
before={{
src: "/packaging/old.jpg",
alt: "Unbranded paper packaging",
label: "2019",
caption: "Six colours, four typefaces, unreadable at arm's length.",
}}
after={{
src: "/packaging/new.jpg",
alt: "Minimal coffee packaging",
label: "Today",
caption: "One ink, uncoated stock, origin on the face of the bag.",
}}
labels={{
playLabel: "Let the seam sweep",
pauseLabel: "Hold the seam still",
frameLabel: "Click to stop the sweep",
}}
/>
);
}| 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 |
before | CompareImage | – | The image revealed to the left of the seam |
after | CompareImage | – | The image revealed to the right of the seam |
duration | number | 7 | Seconds for one full sweep across the frame |
labels | Reveal10Labels | {} | Fixed strings that are not content: the play, pause and frame labels |
className | string | – | Extra classes for the outer <section> |
type CompareImage = {
src: string;
alt: string;
label: string;
caption: string;
};
type Reveal10Labels = {
playLabel?: string;
pauseLabel?: string;
frameLabel?: string;
};duration, and a direction ref flips at each edge, so the seam bounces rather than jumping back to the start.matchMedia("(prefers-reduced-motion: reduce)") is checked before the interval is created, leaving a still comparison that can be clicked.button with an aria-label, so clicking the picture stops the sweep at the clicked position, and the control is reachable by keyboard as a single target.clip-path: inset() on the before layer, so neither photograph is squashed while the visible slice changes.md:grid-cols-[1fr_auto_1fr] row, so it reads as the pivot of the comparison rather than a media button under it.aria-pressed and swaps its own label between the play and pause strings, so its state is announced rather than only drawn.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.
reveal7
Two versions of the same object compared through a segmented pill control: the photographs cross-fade in place while the title, explanation and ruled note list swap beside them.
reveal1
Interactive image comparison component with a draggable divider supporting horizontal and vertical orientations. Perfect for showcasing transformations, photo editing results, or design improvements.
reveal12
Two photographs split across the same grid so each square can be flipped from before to after on click, with buttons to turn the whole frame over and a counter of how much has been revealed.