Pricing
Get Started
  • Introduction
  • Installation
  • MCP Server
  • Saved
Site
  • Builder (Beta)
  • Pricing
  • Roadmap
  • Affiliates
Browse
  • All Components25 New
Text32
Reveal & Decode11
  • Blur Highlight
  • Cipher Reveal
  • Ghost Type
  • Glyph Lottery
  • Luminous Type
  • Signal Type
  • Smoke Type
  • Staggered Text
  • Text Morph
  • Typographic Wall
  • Vapor Type
Kinetic & 3D11
  • 3D Letter Swap
  • 3D Text Reveal
  • Bending Marquee
  • Mesh Lettering
  • Orbital Type
  • Ribbon Type
  • Rising Ink
  • Speeding Text
  • Text Cube
  • Text Path
  • Wave Lettering
Interactive & Physics10
  • ASCII Ripple
  • Domino Lettering
  • Elastic Lettering
  • Glitch Text
  • Gravity Letters
  • Particle Text
  • Shatter Type
  • Spring Lettering
  • Stipple Type
  • Text Scatter
Backgrounds106
Gradients & Fluids21
  • Aura Blob
  • Aurora Blur
  • Chroma Waves
  • Cloud Atlas
  • Color Loops
  • Glowing Ridges
  • Gradient Bars
  • Gradient Blob
  • Grain Wave
  • Liquid Bars
  • Minimal Ripple
  • Radial Liquid
  • Rubber Fluid
  • Satin Ridges
  • Shader Waves
  • Silk Waves
  • Simple Swirl
  • Spectral Clouds
  • Stipple GradientNew
  • Swirl Blend
  • Watercolor
Light & Beams14
  • Aurora Beam
  • Axial Beam
  • Blurred Rays
  • Chroma Blinds
  • Dappled Light
  • Eclipse
  • Falling Rays
  • Flame Paths
  • Horizon Bloom
  • Light Droplets
  • Neon Reveal
  • Nexus Rays
  • Rolling Blinds
  • Shadow Bars
Lines & Filaments12
  • Concentric Tides
  • Glowing Wave
  • Interference Ribbons
  • Liquid Lines
  • Long Exposure
  • Luminous Filaments
  • Neural Flash
  • Neural Float
  • Rising Lines
  • Spiral Funnel
  • Synaptic Shift
  • Twilight Lines
Dots & Pixels22
  • Blinking Dots
  • Blinking Squares
  • Chroma Current
  • Circuit FlashNew
  • Cursor Wave
  • Dither Wave
  • Dot Shift
  • Dotted WavesNew
  • Glue Dots
  • Grid Rise
  • Halftone Vortex
  • Halftone Wave
  • Hexagonal Vault
  • Mosaic
  • Mosaic Waves
  • Pixel Rain
  • Square Matrix
  • Squares Terminal
  • Squircle Shift
  • Tech Wall
  • Thinking Dots
  • Voxel Arc
Particles & Space11
  • Astral Shell
  • Binary Orbits
  • Contour Tide
  • Fading Stars
  • Glimmer Wrap
  • Grain MassNew
  • Ring Field
  • Rising Particles
  • Rotating Stars
  • Spectral Drape
  • Star Burst
Horizons & Tunnels10
  • Glitter Warp
  • Landscape
  • Lightspeed
  • Neural Tunnel
  • Perspective Grid
  • Ravine
  • Retro Lines
  • Star Swipe
  • Vortex
  • Warp Twister
ASCII & Glyphs9
  • ASCII StreamNew
  • ASCII Tiles
  • Ascii Waves
  • Glyph Ember
  • Glyph Orb
  • Glyph Sonar
  • Glyph Tide
  • Liquid Ascii
  • Terminal Rain
Glass & Chrome7
  • Glass CoinsNew
  • Glass Flow
  • Glass KeysNew
  • Glass Tiles
  • Metallic Swirl
  • Prismatic Slats
  • Spectral TilesNew
Images & Galleries52
Galleries & Carousels33
  • Album Rail
  • Bend Gallery
  • Circle Gallery
  • Circle Stack
  • Circles
  • Concave Carousel
  • Constellation Gallery
  • Contact Sheet
  • Depth Ribbon
  • Dolly Gallery
  • Draggable Grid
  • Elastic Reel
  • Expanding Grid
  • Gradient Carousel
  • Helix Gallery
  • Infinite Gallery
  • Inverted Dome
  • Iris Gallery
  • Lenticular Carousel
  • Liquid CirclesNew
  • Momentum Ring
  • Orbit Reel
  • Parallax Carousel
  • Passage Gallery
  • Prism Carousel
  • Reel Gallery
  • Rotating Cards
  • Scroll Bend
  • Skewed Carousel
  • Spin Shutter
  • Tilted Tiles
  • Tumble Carousel
  • Twisting Gallery
Image Effects14
  • Comparison Slider
  • Depth Image
  • Ember Reveal
  • Glass Reveal
  • Hover Preview
  • Liquid Swap
  • Loupe Image
  • Particle Image
  • Particle Morph
  • Pixel Reveal
  • Pixel Sculpt
  • Pixelate Hover
  • Pond Image
  • Shader Reveal
Scroll Stories5
  • Frame Scrub
  • Scroll Mask
  • Scroll Portal
  • Scroll Stack
  • Tile Reveal
Interface30
Cards & Widgets15
  • Animated ListUpdated
  • Arc ListNew
  • Card Spread
  • Chroma Card
  • Click Stack
  • Credit Card
  • Depth Card
  • Frame Border
  • Modal Cards
  • Parallax Cards
  • Parallax Pills
  • Preloader
  • Shader Card
  • SignatureNew
  • Warped Card
Product Mockups8
  • Browser WindowNew
  • Center Flow
  • Code MorphNew
  • Device
  • Magic Transform
  • PipelineNew
  • Spin ViewerNew
  • Terminal ReplayNew
Data & Media7
  • Globe
  • Instrument DialNew
  • Particle ChartNew
  • Signal MapNew
  • Simple Graph
  • Story PlayerNew
  • Waveform PlayerNew
3D & Tactile16
Orbs & Shapes9
  • Agentic Ball
  • AI Blob
  • Black Hole
  • Chrome Orbit
  • Fog Sphere
  • Photon Knot
  • Portal
  • Specter Orb
  • Wireframe Ball
Tactile & Physics7
  • Elastic Sticker
  • KeycapsNew
  • Page Flip
  • Pin ScreenNew
  • Receipt PrinterNew
  • Scratch CardNew
  • Tumble Wall
Cursors19
Custom Cursors7
  • Custom Cursor
  • Drafting Cursor
  • Glass Cursor
  • Gyroscope Cursor
  • Label Orbit
  • Smooth Cursor
  • User Cursor
Cursor Trails12
  • Arc Cursor
  • Ascii Cursor
  • Celebration Cursor
  • Chroma Halo
  • Dither Cursor
  • Glyph Stream
  • Pigment Trail
  • Pixel Magnet
  • Ribbon Trail
  • Snapshot Trail
  • Stardust Cursor
  • Tessera Trail
  1. Docs
  2. Components
  3. Images & Galleries
  4. Image Effects
  5. 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
White apartment volumes with glass balconies against a deep blue sky
Color
The same white apartment volumes and glass balconies in black and white
Monochrome

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