1.0.6 • Published 4 months ago

dualvue v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

DualVue

A React component for comparing two images with a slider.

Installation

npm install dualvue

Usage

Import

import { DualVue } from "dualvue";
import "dualvue/dist/style.css"; // Don't forget to import the styles

Basic usage with defaults

function BasicExample() {
  return (
    <DualVue
      firstImage="path/to/first/image.jpg"
      secondImage="path/to/second/image.jpg"
    />
  );
}

Custom styling example

function CustomExample() {
  return (
    <DualVue
      firstImage="path/to/first/image.jpg"
      secondImage="path/to/second/image.jpg"
      width="1000px"
      height="600px"
      style={{ border: "1px solid #ccc" }}
      className="custom-class"
    />
  );
}

Props

PropTypeRequiredDefaultDescription
firstImagestringYes-URL of the first image
secondImagestringYes-URL of the second image
initialPositionnumberNo50Initial slider position (0-100)
sliderColorstringNo'white'Color of the slider bar
sliderWidthnumberNo2Width of the slider bar in pixels
buttonSizenumberNo40Size of the slider button in pixels
widthstringNo'800px'Width of the component
heightstringNo'400px'Height of the component
classNamestringNo''Additional CSS class names
styleobjectNo{}Additional inline styles