saturation/uisaturation/ui
DocsComponentsBlocksPages
GitHub

Sections

IntroductionComponentsInstallationMCPTheming

Components

ComponentsAccordionAI Chat InputAlertAnimated GroupAnimated NumberAvatarBadgeBeamBlur FadeBorder TrailBreadcrumbButtonButton GroupCalendar PickerCardChartCheckboxCollapsibleComboboxCommandComparison SliderContext MenuCredit CardData TableDate PickerDialogDropdown MenuEmoji PickerEmptyFieldFiltersFull CalendarGlow EffectInputInput GroupInput OTPItemKanbanKbdMenubarNavigation MenuNovel EditorPaginationParallaxProgressProgressive BlurRadio GroupRippleSelectSeparatorSheetSkeletonSliderSonnerSpinnerSpotlightSwitchTableTabsText EffectText ShimmerTextareaToggleToggle GroupTreeTypography
Docs/Components/Comparison Slider

Comparison Slider

An interactive before/after image comparison slider with draggable divider, labels, and responsive design.

Loading...

Installation

pnpm dlx shadcn@latest add https://ui.saturation.io/r/comparison-slider.json

Tailwind v4 — Source Scanning

Saturation UI copies component source into your project via the shadcn registry (no npm package). If Tailwind v4 isn't scanning your components directory, add this to your CSS entry file:

@source "../components";

This ensures all utility classes in CVA variants and data attribute selectors are included in your build.

Usage

import { ComparisonSlider } from "@/components/ui/comparison-slider"
<ComparisonSlider
  beforeImage={{ src: "/before.jpg", alt: "Before" }}
  afterImage={{ src: "/after.jpg", alt: "After" }}
  beforeLabel="Before"
  afterLabel="After"
/>

API Reference

PropTypeDefaultDescription
beforeImage*{ src: string; alt: string }—Left/before image.
afterImage*{ src: string; alt: string }—Right/after image.
beforeLabelstring"Before"Label for the left side.
afterLabelstring"After"Label for the right side.
defaultPositionnumber50Initial slider position (0-100).
aspectRatiostring"aspect-video"Tailwind aspect ratio class.
classNamestring—Additional CSS classes.
PreviousCommandNextContext Menu

On This Page

  • Installation
  • Usage
  • API Reference
Color graded footage
Original footage
Original
Color Graded

Drag to compare