Ndeko UI Pro is live - Advanced components and templates to help you build delightful websites, faster.

Image Comparison

Interactively compare two images with a draggable slider to reveal differences.

Examples

Image Comparison Basic

Ndeko UI  DarkNdeko UI  Light

Image Comparison with hover

Ndeko UI  DarkNdeko UI  Light

Image Comparison with spring options

Ndeko UI  DarkNdeko UI  Light

Image Comparison with custom slider

Ndeko UI  DarkNdeko UI  Light

Installation

npx ndekoui@latest add image-comparison

Component API

ImageComparison

PropTypeDefaultDescription
childrenReact.ReactNodeImageComparisonImage components.
classNamestringundefinedOptional CSS class for styling the component.
enableHoverbooleanfalseControls whether hover effects are enabled.
springOptionsSpringOptions{ bounce: 0, duration: 0 }Options for customizing the spring animation.

ImageComparisonImage

PropTypeDefaultDescription
classNamestringundefinedOptional CSS class for styling the component.
altstringThe alt text for the image.
srcstringThe source URL of the image.
position'left' | 'right''left'The position of the image.

ImageComparisonSlider

PropTypeDefaultDescription
classNamestringundefinedOptional CSS class for styling the component.