0.1.7 • Published 9 months ago

@mahfujul-sagor/native-image-comparison-slider v0.1.7

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

Native Image Comparison Slider

Compare any two images side by side in your React Native app.

Example

Installation

To install the package, run the following command:

npm install @mahfujul-sagor/native-image-comparison-slider

or

npm i native-image-comparison-slider

Props

PropTypeRequiredDefault ValueDescription
beforeImageSourcePropType or stringundefinedThe first image to display in the slider.
afterImageSourcePropType or stringundefinedThe second image to display in the slider.
containerSize{ width: number; height: number; }{ width: '100%', height: '100%' }Dimensions of the container.
sliderSize{ width: number; height: number; }{ width: 50, height: 50 }Dimensions of the slider's handle.
SliderComponentReactNodeundefinedCustom component for the slider's handle.
sliderStylesViewStyleundefinedStyles for the slider's handle.
showSeparationLinebooleanundefinedWhether to show the separation line.
separationLineStylesViewStyleundefinedStyles for the separation line.
resizeModeImageResizeMode'cover'How to resize the image when the frame does not match its size.

Usage

Here's a basic example of how to use the CompareSlider component:

import { CompareSlider } from '@mahfujul-sagor/native-image-comparison-slider';
// or
// import { CompareSlider } from 'native-image-comparison-slider';

const beforeImage = require('./path/to/beforeImage.png');
const afterImage = require('./path/to/afterImage.png');

<CompareSlider
  before={beforeImage}
  after={afterImage}
  containerSize={{ width: 350, height: 100 }}
/>;

Contributing

If you'd like to contribute, check out the contributing guide for more information on the development workflow and how to get involved.

License

This project is licensed under the MIT License.


Created using create-react-native-library

0.1.7

9 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago