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.
Two states of the same thing, switched with a segmented control in the header. The photograph cross-fades while the statement, paragraph and ruled notes beside it swap to match.
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/reveal7?email=YOUR_EMAIL&license_key=YOUR_KEY"Base UI flavor
npx shadcn add "https://ui.beste.co/r-base/reveal7?email=YOUR_EMAIL&license_key=YOUR_KEY"This installs the block to components/beste/block/reveal7.tsx plus the badge7 eyebrow it uses.
The installed file exports reveal7Demo alongside the block: the exact props behind the preview above. Spread it to get a working comparison in one line.
import { Reveal7, reveal7Demo } from "@/components/beste/block/reveal7";
export default function Page() {
return <Reveal7 {...reveal7Demo} />;
}Then replace the demo with your own props. Written out, a trimmed setup looks like this:
import { Reveal7 } from "@/components/beste/block/reveal7";
export default function Page() {
return (
<Reveal7
badge={{ label: "Switch it" }}
heading="The old bag and the one that replaced it."
states={[
{
label: "2019 packaging",
title: "Illustrated, crowded, unreadable at arm's length",
description: "Six colours, a hand-drawn scene and four typefaces.",
src: "/packaging/old.jpg",
alt: "Unbranded paper packaging",
notes: ["Six-colour print run", "Origin buried on the reverse"],
},
{
label: "Current packaging",
title: "One colour, one voice and the origin on the front",
description: "Uncoated stock, a single ink and the name doing the work.",
src: "/packaging/new.jpg",
alt: "Minimal coffee packaging",
notes: ["Single-colour print run", "Origin and roast date on the face"],
},
]}
/>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
badge | { label: string } | – | Eyebrow label rendered as a Badge7 |
heading | string | – | Section heading in the header row |
states | CompareState[] | [] | The states being compared, one segment each |
className | string | – | Extra classes for the outer <section> |
type CompareState = {
label: string;
title: string;
description: string;
src: string;
alt: string;
notes: string[];
};useState(states.length > 1 ? 1 : 0)), so a visitor sees the current version first and switches back to the old one deliberately.transition-opacity duration-500, so switching never shows an empty frame while a file downloads.button elements with aria-pressed, sitting in a bg-muted track with the selected pill on bg-background, so the state is exposed as well as drawn.ul with a border-t rule per row, which lets the two lists line up against each other when you flip between the states.items-end), so switching does not require scrolling past the picture.aspect-[4/3] becoming md:aspect-[3/2]), so both states are cropped identically at every width and the comparison stays honest.max-w-md in the side column, so the two states' text blocks occupy the same measure and differences in length read as content rather than layout.reveal13
Press-and-hold comparison: holding the frame or the button cross-fades the earlier photograph in and swaps the corner label and caption, releasing returns to the current one.
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.
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.
reveal8
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.