All Projects β†’ nerdyman β†’ react-compare-slider

nerdyman / react-compare-slider

Licence: MIT license
A slider component to compare any two React components in landscape or portrait orientation. It supports custom images, videos... and everything else.

Programming Languages

typescript
32286 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to react-compare-slider

hyperdiff
Find common, removed and added element between two collections.
Stars: ✭ 14 (-82.05%)
Mutual labels:  comparison
react-circle-flags
πŸš€ A React component with a collection of 300+ minimal circular SVG country flags. Wrapper of HatScripts/circle-flags
Stars: ✭ 29 (-62.82%)
Mutual labels:  react-component
missCompare
missCompare R package - intuitive missing data imputation framework
Stars: ✭ 31 (-60.26%)
Mutual labels:  comparison
gatsby-starter-wordpress-twenty-twenty
A port of the WordPress Twenty Twenty theme to Gatsby.
Stars: ✭ 141 (+80.77%)
Mutual labels:  twentytwenty
react-native-stateview
A react native wrapper view to add loading, content, error and placeholder states to your component
Stars: ✭ 28 (-64.1%)
Mutual labels:  react-component
ncdu-diff
ncdu fork that can compare and diff results
Stars: ✭ 21 (-73.08%)
Mutual labels:  comparison
animation-wrapper-view
Declarative animations with imperative controls for RN/RNW.
Stars: ✭ 53 (-32.05%)
Mutual labels:  react-component
react-simple-range
πŸ”‰ React slider component for inputting a numeric value within a range.
Stars: ✭ 20 (-74.36%)
Mutual labels:  react-component
delete-react-zombies
CLI to search and delete unimported 🧟components in your react βš›οΈ files
Stars: ✭ 70 (-10.26%)
Mutual labels:  react-component
stringosim
String similarity functions, String distance's, Jaccard, Levenshtein, Hamming, Jaro-Winkler, Q-grams, N-grams, LCS - Longest Common Subsequence, Cosine similarity...
Stars: ✭ 47 (-39.74%)
Mutual labels:  comparison
react-markdown-heading
Render markdown table of contents as React component.
Stars: ✭ 18 (-76.92%)
Mutual labels:  react-component
hood
The plugin to manage benchmarks on your CI
Stars: ✭ 17 (-78.21%)
Mutual labels:  comparison
react-jsonschema-form-layout
Simple Layout Field to offer a variety possibilities to react-jsonschema-forms
Stars: ✭ 67 (-14.1%)
Mutual labels:  react-component
react-async-button
React button component for handling async actions
Stars: ✭ 31 (-60.26%)
Mutual labels:  react-component
create-chakra-icons
Transform SVGs to React Chakra UI <Icon /> ✨
Stars: ✭ 80 (+2.56%)
Mutual labels:  react-component
React-Limited-Infinite-Scroll
A limited infinite scroll component for React(Reactζœ‰ι™ζ— ι™εŠ θ½½η»„δ»Ά)
Stars: ✭ 37 (-52.56%)
Mutual labels:  react-component
react-sweet-progress
A way to quickly add a progress bar to react app 🌈
Stars: ✭ 250 (+220.51%)
Mutual labels:  react-component
win95-media-player
πŸ’Ώ Back from 1995, and running on your website
Stars: ✭ 56 (-28.21%)
Mutual labels:  react-component
react-fusionui
☒️ Nuclear power-up for your UI.
Stars: ✭ 13 (-83.33%)
Mutual labels:  react-component
arabic-text-diacritization
Benchmark Arabic text diacritization dataset
Stars: ✭ 41 (-47.44%)
Mutual labels:  comparison

React Compare Slider

Compare two components side-by-side or top-to-toe.

Example

License MIT NPM package Bundle size
Build Status Coverage Demos

Features

  • Supports responsive images and any other React components (picture, video, canvas, iframe etc.)
  • Supports landscape and portrait orientations
  • Simple API
  • Unopinionated & fully customizable – optionally use your own components and styles
  • Responsive, fluid
  • Teeny-tiny
  • Zero dependencies
  • Type safe

Demo

Usage

Install

yarn add react-compare-slider
# OR
npm install react-compare-slider

Basic Image Usage

You may use ReactCompareSliderImage to render images or use your own custom components.

import { ReactCompareSlider, ReactCompareSliderImage } from 'react-compare-slider';

<ReactCompareSlider
  itemOne={<ReactCompareSliderImage src="..." srcSet="..." alt="Image one" />}
  itemTwo={<ReactCompareSliderImage src="..." srcSet="..." alt="Image two" />}
/>

See the Images docs for more information and demos.

Props

Prop Type Required Default value Description
boundsPadding number 0 Padding to limit the slideable bounds in pixels on the X-axis (landscape) or Y-axis (portrait).
changePositionOnHover boolean false Whether the slider should follow the pointer on hover.
handle ReactNode undefined Custom handle component.
itemOne ReactNode βœ“ undefined First component to show in slider.
itemTwo ReactNode βœ“ undefined Second component to show in slider.
onlyHandleDraggable boolean false Whether to only change position when handle is interacted with (useful for touch devices).
onPositionChange function undefined Callback on position change, returns current position percentage as argument (position) => { ... }.
portrait boolean false Whether to use portrait orientation.
position number 50 Initial percentage position of divide (0-100).

See the API docs for more information.

Extending

Custom Items

The library supports all types of React components.

Custom components can apply the same base styles as ReactCompareSliderImage by using the styleFitContainer CSS utility.

Custom Handles

Custom Handles

See the Handles docs for more information.

Requirements

Notes

Bootstrapped with TSDX.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].