Pricing
Get Started
  • Introduction
  • Installation
  • MCP Server
  • Saved
Site
  • Builder (Beta)
  • Pricing
  • Roadmap
  • Affiliates
Browse
  • All Components80 New
Text34
  • 3D Letter Swap
  • 3D Text Reveal
  • ASCII Ripple
  • Bending Marquee
  • Blur Highlight
  • Cipher RevealNew
  • Domino LetteringNew
  • Elastic LetteringNew
  • Ghost TypeNew
  • Glitch Text
  • Glyph LotteryNew
  • Gravity LettersNew
  • Label OrbitNew
  • Luminous TypeNew
  • Mesh LetteringNew
  • Orbital TypeNew
  • Particle Text
  • Ribbon TypeNew
  • Rising InkNew
  • Shatter TypeNew
  • Signal TypeNew
  • Smoke TypeNew
  • Speeding Text
  • Spring LetteringNew
  • Staggered Text
  • Stipple TypeNew
  • Tessera TrailNew
  • Text Cube
  • Text MorphNew
  • Text Path
  • Text Scatter
  • Typographic WallNew
  • Vapor TypeNew
  • Wave LetteringNew
Backgrounds98
  • ASCII Tiles
  • Ascii Waves
  • Astral ShellNew
  • Aura Blob
  • Aurora Beam
  • Aurora Blur
  • Axial BeamNew
  • Binary OrbitsNew
  • Black Hole
  • Blinking Dots
  • Blinking Squares
  • Blurred Rays
  • Chroma Blinds
  • Chroma CurrentNew
  • Chroma Waves
  • Cloud AtlasNew
  • Color Loops
  • Concentric TidesNew
  • Contour TideNew
  • Dappled LightNew
  • Dither Wave
  • Dot Shift
  • Eclipse
  • Fading StarsNew
  • Falling Rays
  • Flame Paths
  • Fog Sphere
  • Glass Flow
  • Glass Tiles
  • Glimmer WrapNew
  • Glitter Warp
  • Glowing Ridges
  • Glowing Wave
  • Glue Dots
  • Glyph EmberNew
  • Glyph OrbNew
  • Glyph SonarNew
  • Glyph TideNew
  • Gradient Bars
  • Grain Wave
  • Halftone Vortex
  • Halftone Wave
  • Hexagonal VaultNew
  • Horizon BloomNew
  • Interference RibbonsNew
  • Landscape
  • Light Droplets
  • Lightspeed
  • Liquid Bars
  • Liquid Lines
  • Long Exposure
  • Luminous FilamentsNew
  • Metallic Swirl
  • Minimal Ripple
  • Mosaic
  • Mosaic Waves
  • Neon Reveal
  • Neural Flash
  • Neural Float
  • Neural Tunnel
  • Nexus RaysNew
  • Perspective Grid
  • Photon KnotNew
  • Pixel Rain
  • Prismatic SlatsNew
  • Radial Liquid
  • Ravine
  • Retro Lines
  • Ring FieldNew
  • Rising Lines
  • Rising Particles
  • Rolling Blinds
  • Rotating Stars
  • Rubber Fluid
  • Satin RidgesNew
  • Shader Waves
  • Shadow Bars
  • Silk Waves
  • Simple Swirl
  • Specter Orb
  • Spectral Clouds
  • Spectral DrapeNew
  • Spiral FunnelNew
  • Square Matrix
  • Squares Terminal
  • Squircle Shift
  • Star Swipe
  • Swirl Blend
  • Synaptic Shift
  • Tech Wall
  • Terminal RainNew
  • Thinking Dots
  • Twilight Lines
  • Vortex
  • Voxel ArcNew
  • Warp Twister
  • Watercolor
  • Wireframe Ball
3D & Shaders49
  • Agentic Ball
  • AI Blob
  • Album RailNew
  • Bend Gallery
  • Chrome OrbitNew
  • Circle Stack
  • Concave CarouselNew
  • Constellation GalleryNew
  • Contact SheetNew
  • Depth Card
  • Depth Image
  • Depth RibbonNew
  • Device
  • Dolly Gallery
  • Elastic ReelNew
  • Elastic StickerNew
  • Ember RevealNew
  • Expanding GridNew
  • Frame Border
  • Glass Reveal
  • Globe
  • Gradient Blob
  • Helix GalleryNew
  • Infinite Gallery
  • Inverted Dome
  • Iris GalleryNew
  • Lenticular Carousel
  • Momentum RingNew
  • Page Flip
  • Parallax Carousel
  • Particle Image
  • Particle Morph
  • Passage GalleryNew
  • Pixel Reveal
  • Pixel Sculpt
  • Pixelate Hover
  • Pond ImageNew
  • Portal
  • Prism CarouselNew
  • Rotating Cards
  • Scroll BendNew
  • Scroll Portal
  • Shader Card
  • Shader Reveal
  • Spin ShutterNew
  • Star Burst
  • Tumble Carousel
  • Twisting Gallery
  • Warped Card
Cursor Effects21
  • Arc CursorNew
  • Ascii Cursor
  • Celebration CursorNew
  • Chroma HaloNew
  • Cursor Wave
  • Custom Cursor
  • Dither Cursor
  • Drafting CursorNew
  • Glass Cursor
  • Glyph StreamNew
  • Grid Rise
  • Gyroscope CursorNew
  • Liquid Ascii
  • Parallax Pills
  • Pigment TrailNew
  • Pixel Magnet
  • Ribbon TrailNew
  • Smooth Cursor
  • Snapshot TrailNew
  • Stardust CursorNew
  • User Cursor
UI & Cards28
  • Animated List
  • Card Spread
  • Center Flow
  • Chroma Card
  • Circle Gallery
  • Circles
  • Click Stack
  • Comparison Slider
  • Credit Card
  • Draggable Grid
  • Frame Scrub
  • Gradient Carousel
  • Hover Preview
  • Liquid Swap
  • Loupe ImageNew
  • Magic Transform
  • Modal Cards
  • Orbit ReelNew
  • Parallax Cards
  • Preloader
  • Reel Gallery
  • Scroll Mask
  • Scroll Stack
  • Simple Graph
  • Skewed Carousel
  • Tile Reveal
  • Tilted Tiles
  • Tumble WallNew
  1. Docs
  2. Components
  3. UI & Cards
  4. Comparison Slider

Animated components, blocks, and templates for React. Pay once, ship stunning pages forever.

pro@reactbits.dev

Site

HomeBuilder (Beta)PricingTestimonialsFAQsRoadmapChangelogFree Components

Docs

IntroductionInstallationMCP ServerComponentsBlocksTemplates

Resources

AboutUse casesComparisonsAlternativesFor AI agents

Legal & Account

LoginAffiliateLicensePrivacyContact

© 2026 pro.reactbits.dev. All rights reserved.

Comparison Slider

A before and after image slider

comparison-slider-tw
Offset violet and pink geometric discs cut by a warm apricot plane
Spectrum
The same geometric discs and diagonal plane in a vivid coral and violet palette
Color shift

Customize

Initial Position
50
Divider Color
Divider Width
3
Handle Color
Handle Size
36

Props

30
NameTypeDefaultDescription
beforeImagestring""URL for the before image (left/top layer)
afterImagestring""URL for the after image (right/bottom layer)
beforeAltstring"Before"Alt text for the before image
afterAltstring"After"Alt text for the after image
initialPositionnumber50Initial position of the slider (0-100)
orientation"horizontal" | "vertical""horizontal"Orientation of the slider
enableInertiabooleantrueEnable inertia/momentum on drag release
dragOnHoverbooleanfalseEnable drag on hover without clicking
autoAnimatebooleanfalseAuto-animate slider with smooth random movement
dividerWidthnumber3Width of the divider line in pixels
showHandlebooleantrueShow the draggable handle with icon
handleSizenumber48Size of the handle in pixels
handleIconReact.ReactNodeundefinedCustom icon component for the handle
dividerColorstring"white"Color of the divider line
handleColorstring"white"Color of the handle background
onPositionChange(position: number) => voidundefinedCallback when slider position changes
classNamestring""Additional CSS classes for the container
imageClassNamestring""Additional CSS classes for both images
showLabelsbooleanfalseShow before/after labels on images
labelText{ before: string; after: string }{ before: "Before", after: "After" }Custom text for labels
labelPosition"top-left" | "top-right" | "bottom-left" | "bottom-right""top-left"Position of the labels
labelClassNamestring""Additional CSS classes for both labels
beforeLabelClassNamestring""Additional CSS classes for before label
afterLabelClassNamestring""Additional CSS classes for after label
showPercentagebooleanfalseShow percentage indicator
percentagePosition"top" | "bottom""top"Position of percentage indicator
onDragStart() => voidundefinedCallback when drag starts
onDragEnd() => voidundefinedCallback when drag ends
ariaLabelstring"Image comparison slider"Custom ARIA label for accessibility
reducedMotionbooleanfalseRespect prefers-reduced-motion setting
beforeImagestring

URL for the before image (left/top layer)

Default""
afterImagestring

URL for the after image (right/bottom layer)

Default""
beforeAltstring

Alt text for the before image

Default"Before"
afterAltstring

Alt text for the after image

Default"After"
initialPositionnumber

Initial position of the slider (0-100)

Default50
orientation"horizontal" | "vertical"

Orientation of the slider

Default"horizontal"
enableInertiaboolean

Enable inertia/momentum on drag release

Defaulttrue
dragOnHoverboolean

Enable drag on hover without clicking

Defaultfalse
autoAnimateboolean

Auto-animate slider with smooth random movement

Defaultfalse
dividerWidthnumber

Width of the divider line in pixels

Default3
showHandleboolean

Show the draggable handle with icon

Defaulttrue
handleSizenumber

Size of the handle in pixels

Default48
handleIconReact.ReactNode

Custom icon component for the handle

Defaultundefined
dividerColorstring

Color of the divider line

Default"white"
handleColorstring

Color of the handle background

Default"white"
onPositionChange(position: number) => void

Callback when slider position changes

Defaultundefined
classNamestring

Additional CSS classes for the container

Default""
imageClassNamestring

Additional CSS classes for both images

Default""
showLabelsboolean

Show before/after labels on images

Defaultfalse
labelText{ before: string; after: string }

Custom text for labels

Default{ before: "Before", after: "After" }
labelPosition"top-left" | "top-right" | "bottom-left" | "bottom-right"

Position of the labels

Default"top-left"
labelClassNamestring

Additional CSS classes for both labels

Default""
beforeLabelClassNamestring

Additional CSS classes for before label

Default""
afterLabelClassNamestring

Additional CSS classes for after label

Default""
showPercentageboolean

Show percentage indicator

Defaultfalse
percentagePosition"top" | "bottom"

Position of percentage indicator

Default"top"
onDragStart() => void

Callback when drag starts

Defaultundefined
onDragEnd() => void

Callback when drag ends

Defaultundefined
ariaLabelstring

Custom ARIA label for accessibility

Default"Image comparison slider"
reducedMotionboolean

Respect prefers-reduced-motion setting

Defaultfalse