Description
React Compare Image is a React component that lets visitors compare two images with a draggable slider. You pass in a left and a right image, and the slider reveals one over the other as it moves. It supports horizontal and vertical comparison, and it is responsive, always fitting the width of its parent element. You can set the handle size, make it slide on hover, change the slider line color and width, add labels such as before and after, and show a skeleton element while images load. A callback reports the slider position each time it changes. The aspectRatio prop chooses how to handle images with different proportions. Version 1 and later need React 16.8 or newer, so older projects should use version 0. The README includes a demo and sample code, and the props table lists the options.…
Highlights
- Horizontal and vertical image comparison slider
- Responsive, fits the width of its parent
- Custom handle, labels and slider line styling
- Skeleton shown while images load
- Callback on slider position change
Ratings & Reviews
No ratings yet
Be the first to rate react-compare-image.
People also visit
react-compare-image FAQ
What is React Compare Image?
A React component that compares two images with a slider, for before and after views or similar side-by-side checks.
Which React version does it need?
Version 1 or later needs React 16.8 or newer. Projects on older React should use version 0.
Can I customize the slider?
Yes. You can change the handle size and element, the line color and width, add labels, slide on hover, and style each image.
Where are the options listed?
The README has a props table with each option, its type, default value and description, plus a demo and sample code.
What are the best react-compare-image alternatives?
Popular alternatives to react-compare-image include react-image-gallery, react-inner-image-zoom and gatsby-background-image. See all react-compare-image alternatives




















