1.0.0 • Published 5 years ago

react-swipe-view-fork v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

react-swipe-view-fork

a fork npm from https://github.com/legeneek/react-swipe-view

install

npm i react-swipe-view-fork

usage

import SwipeView from 'react-swipe-view-fork'

<SwipeView cur={0} num={5} tabWidth={375} tabChange={tabChange} onSwipe={onSwipe} animation={{duration:0.3, timing: 'ease', delay: 0}} disableTouch={['.disabled']}>
    {views}
</SwipeView>

check the demo code at example folder and effect here

Prop Types

PropertyTypeRequired?Description
numNumbertotal number of tab view
tabWidthNumberwidth of each tab view
curNumbercurrent tab index start from 0, default 0
fastSwipeTimeNumberswipe time less then fastSwipeTime(default 300ms) will cause tab view change
tabChangeFunctioncallback invoked when tab view changed by user's gesture (index: Number): void
onSwipeFunctioncallback invoked when user is sliding (isSwipe: Boolean):void, if user is sliding horizontally isSwipe is true else false
containerStyleObjectthis component use display: flex to layout inner tab views, set containerStyle to change it
animationObjectdefine the animation props for tab transition. eg:{duration: 0.3, timing: 'ease', delay: 0}
disableTouchArrayan array of dom selectors, indicate the dom not trigger touch effect. eg: ['.disabled', '.no-touch']. selector should not use ,
1.0.0

5 years ago

0.2.0

5 years ago

0.1.0

6 years ago