voronianski/react-swipe
소개
:left_right_arrow: Swipe.js를 React 컴포넌트로 사용
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 0
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalreact-swipe
Brad Birdsall's Swipe.js as a React component.
Demo
Check out the demo from a mobile device (real or emulated).

Install
npm install react swipe-js-iso react-swipe --save
Usage
Examples
import React from 'react';
import ReactDOM from 'react-dom';
import ReactSwipe from 'react-swipe';
const Carousel = () => {
let reactSwipeEl;
return (
<div>
<ReactSwipe
className="carousel"
swipeOptions={{ continuous: false }}
ref={el => (reactSwipeEl = el)}
>
<div>PANE 1</div>
<div>PANE 2</div>
<div>PANE 3</div>
</ReactSwipe>
<button onClick={() => reactSwipeEl.next()}>Next</button>
<button onClick={() => reactSwipeEl.prev()}>Previous</button>
</div>
);
};
ReactDOM.render(<Carousel />, document.getElementById('app'));
Props
swipeOptions: ?Object- supports all original options from Swipe.js config. If passed object differs from the previous onereact-swipewill re-initiate underlying Swipe.js instance with fresh optionsstyle: ?Object- object with 3 keys (see defaults):container: ?Objectwrapper: ?Objectchild: ?Object
regular props as
className,idfor root component are also supportedchildCount: ?Number- use it to explicitely tellreact-swipethat it needs to re-initiate underlying Swipe.js instance. For example, by setting thechildCountprop to thelengthof the images array that you pass intoreact-swipe, re-rendering will take place when theimages.lengthdiffers from the previousrenderpass:
<ReactSwipe childCount={images.length}>{images}</ReactSwipe>
Methods
Component proxies all Swipe.js instance methods.
Playground
Configure the ReactSwipe component in a sandbox environment at CodeSandbox.
MIT Licensed
관련 프로젝트 살펴보기
불러오는 중…