Comparison Slider with Highlights

Compare

See the difference

Drag the slider to compare the before and after states. Our solution delivers measurable improvements.

Performance boost

Up to 3x faster load times with optimized rendering.

Better clarity

Enhanced visuals with improved contrast and sharpness.

Reduced noise

Cleaner output with advanced noise reduction algorithms.

After
Before
Before
After
About this block

Comparison Slider with HighlightsFREE

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.

Reveal2: Comparison Slider with Highlights

Split-layout comparison section pairing a benefits sidebar (badge, heading, description, up to six highlight rows) with the same drag-to-reveal before/after slider used in reveal1, embedded in a 12-column grid.

Free block

This block is free. No license or account is required: install it with the CLI and use it in unlimited projects.

Installation

Radix flavor

bash
npx shadcn add "https://ui.beste.co/r/reveal2"

Base UI flavor

bash
npx shadcn add "https://ui.beste.co/r-base/reveal2"

This installs the block to components/beste/block/reveal2.tsx and the badge shadcn/ui primitive it depends on.

Quick start

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

tsx
import { Reveal2, reveal2Demo } from "@/components/beste/block/reveal2";

export default function ShowcasePage() {
  return <Reveal2 {...reveal2Demo} />;
}

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

tsx
import { Check, Zap } from "lucide-react";
import { Reveal2 } from "@/components/beste/block/reveal2";

export default function ShowcasePage() {
  return (
    <Reveal2
      badge={{ label: "Compare", variant: "secondary" }}
      heading="See the difference"
      description="Drag to compare the before and after states."
      highlights={[
        { id: "speed", icon: <Zap className="size-5" />, title: "Faster load times" },
        { id: "quality", icon: <Check className="size-5" />, title: "Sharper output" },
      ]}
      beforeImage={{ src: "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=1200&h=800&fit=crop&sat=-100", alt: "Before" }}
      afterImage={{ src: "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=1200&h=800&fit=crop", alt: "After" }}
    />
  );
}

Props

PropTypeDefaultDescription
badge{ label: string; variant?: "default" | "secondary" | "outline" }Small badge above the heading
headingstringMain headline
descriptionstringSupporting copy below the heading
highlightsHighlight[][]Benefit rows in the sidebar, capped at six
beforeImage{ src: string; alt: string }Image clipped by the divider
afterImage{ src: string; alt: string }Full-bleed background image
beforeLabelstring"Before"Pill label over beforeImage
afterLabelstring"After"Pill label over afterImage
showLabelsbooleantrueToggles the Before/After pill labels
orientation"horizontal" | "vertical""horizontal"Drag axis and divider orientation
initialPositionnumber50Starting divider position, 0-100
dividerWidthnumber4Divider bar thickness in pixels
classNamestringExtra classes for the outer <section>
ts
type Highlight = {
  id: string;
  icon?: React.ReactNode;
  title: string;
  description?: string;
};

Behavior notes

  • Unlike reveal1, beforeImage/afterImage are optional here: if either is missing, its layer renders a muted placeholder box with " image" text instead of an <img>, so the slider still works before real photography is wired in.
  • highlights is sliced to the first six entries (highlights.slice(0, 6)) regardless of how many are passed, so extra items beyond six are silently dropped.
  • The drag mechanics (pointer/touch listeners on document, clip-path reveal, ARIA slider role with no keyboard handling) are identical to reveal1; only the layout differs, splitting into a lg:col-span-5 content column and a lg:col-span-7 slider column that stack on smaller screens.
  • The slider's aspect ratio is fixed at 16/10 here versus reveal1's aspect-video (16/9), and the divider handle is styled inverted (white circle with a primary-colored grip icon and border) instead of reveal1's primary-filled handle.

More Reveal blocks

View all Reveal
PRO

reveal6

Drag Compare Slider

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.

FREE

reveal1

Before/After Image Slider

Interactive image comparison component with a draggable divider supporting horizontal and vertical orientations. Perfect for showcasing transformations, photo editing results, or design improvements.

PRO

reveal8

Vertical Split Compare

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.

PRO

reveal9

Spotlight Lens Compare

Before and after comparison seen through a draggable circular lens: the earlier photograph fills the frame while the later one shows only inside the circle, which follows the pointer or the arrow keys.

PRO

reveal12

Tile Flip Compare

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.

PRO

reveal11

Diagonal Peel Compare

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.