Manual Swiper

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 10

DownloadManual Swiper
Open PDF In BrowserView PDF
10/4/2019

leecade/react-native-swiper: The best Swiper component for React Native.

leecade / react-native-swiper

The best Swiper component for React Native.
# swipe # react-native # react

309 commits
Branch: master

26 branches

22 releases

New pull request

56 contributors
Create new file

arribbar Merge pull request #897 from leecade/release1.5.14

…

MIT

Upload files

Find File

Clone or download

Latest commit e4dbde6 on 26 Nov 2018

.github

update issue template to get more info

2 years ago

examples

#684 to fix onScrollBeginDrag not being called on Android

8 months ago

src

resolve styling conflict

5 months ago

.editorconfig

first ci

4 years ago

.gitignore

Ignore dist/ directory.

3 years ago

.npmignore

first ci

4 years ago

CHANGELOG.md

Release 1.5.14

5 months ago

LICENSE

Initial commit

4 years ago

README.md

Merge pull request #838 from thealiilman/patch-1

ROADMAP.md

bump versiom 1.5.2

index.d.ts

Correcting type `autoplayTimeout: number` prop

index.js

Improve develop workflow prepare for 1.5.0

index.js.flow

Add flow definitions

7 months ago

package.json

Release 1.5.14

5 months ago

yarn.lock

bump version 1.5.4

7 months ago
3 years ago
a year ago
3 years ago

2 years ago

README.md

Hi there:
[

头条财经前端团队急招] 了解团队 / 投简历请联系:

微信: 103024979 / 邮箱: leecade@163.com
「全新团队, 全新产品, 全新技术栈, 不设技术边界, 不设管理, 不装」
要求: 参考头条面试标准 (重度: Node / RN / Vue / React / 微服务 等技术向)

https://github.com/leecade/react-native-swiper#installation

1/10

10/4/2019

leecade/react-native-swiper: The best Swiper component for React Native.

The best Swiper component for React Native.
code style standard

npm v1.5.14

downloads 141k/m

issue stats no longer available

issue stats no longer available

chat on gitter

react-native-swiper
Roadmap
see: ROADMAP.md

Changelogs
[1.5.6]
Fix #16, #36, #371, #410, #411, #422, #468 Fix landscape orientation auto resize! (thanks @ahmed3mar,
@timmywil)
Add containerStyle prop to customize the view container.
[1.5.5]
Update: using PropTypes from prop-types and Change View.propTypes to ViewPropTypes
[1.5.4]
Added easily accessible pagination point manipulation: use dotColor / activeDotColor and dotStyle /
activeDotStyle (thanks @denizs)

Added scrollEnabled prop to documentation (thanks @ibandominguez)
[1.5.3]
Add loadMinimalLoader prop to customize  (thanks @Exilz)
Disable autoplay timer when prop changes to false (thanks @dizlexik)
Special thanks to @hypatiah for fixed some grammatical errors in README
[1.5.2]
Add yarn lock
Fix jitter when quickly swiping back and forth between pages (iOS) (thanks @nemophrost)
The first webview always reloaded when injecting the rest of the children (thanks @eosterberg)
see more: CHANGELOG.md

Show Cases
Try these cases by yourself very easy, Just open examples/ios/swiper.xcodeproj in Xcode, then press Cmd + R ; you may
edit examples/index.ios.js for switch cases.
https://github.com/leecade/react-native-swiper#installation

2/10

10/4/2019

leecade/react-native-swiper: The best Swiper component for React Native.

examples/components/Basic

examples/components/Swiper

examples/components/SwiperNumber

https://github.com/leecade/react-native-swiper#installation

3/10

10/4/2019

leecade/react-native-swiper: The best Swiper component for React Native.

examples/components/Phone

examples/components/LoadMinimal
https://github.com/leecade/react-native-swiper#installation

4/10

10/4/2019

leecade/react-native-swiper: The best Swiper component for React Native.

Getting Started
Installation
Basic Usage
Properties
Basic
Custom basic style & content
Pagination
Autoplay
Control buttons
Props of Children
Basic props of 
Supported ScrollResponder
Examples
Development

Installation
$ npm i react-native-swiper --save

Basic Usage
Install react-native first
$ npm i react-native-cli -g

Initialization of a react-native project
$ react-native init myproject

Then, edit myproject/index.ios.js , like this:
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import Swiper from 'react-native-swiper';

https://github.com/leecade/react-native-swiper#installation

5/10

10/4/2019

leecade/react-native-swiper: The best Swiper component for React Native.
const styles = StyleSheet.create({
wrapper: {
},
slide1: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#9DD6EB',
},
slide2: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#97CAE5',
},
slide3: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#92BBD9',
},
text: {
color: '#fff',
fontSize: 30,
fontWeight: 'bold',
}
})
export default class Swiper extends Component {
render(){
return (


Hello Swiper


Beautiful


And simple


);
}
}
AppRegistry.registerComponent('myproject', () => Swiper);

Properties
Basic
Prop

Default

Type

horizontal

true

bool

loop

true

bool

index

0

number

showsButtons

false

bool

Set to true make control buttons visible.

autoplay

false

bool

Set to true enable auto play mode.

https://github.com/leecade/react-native-swiper#installation

Description
If true , the scroll view's children are arranged horizontally in a row
instead of vertically in a column.
Set to false to disable continuous loop mode.
Index number of initial slide.

6/10

10/4/2019

leecade/react-native-swiper: The best Swiper component for React Native.

Prop
onIndexChanged

Default
(index) =>
null

Type

Description

func

Called with the new index when the user swiped

Custom basic style & content
Prop

Default

Type

width

-

number

If no specify default enable fullscreen mode by flex: 1 .

height

-

number

If no specify default fullscreen mode by flex: 1 .

style

{...}

style

See default style in source.

containerStyle

{...}

style

See default container style in source.

false

bool

1

number

see loadMinimal

element

Custom loader to display when slides aren't loaded

loadMinimal
loadMinimalSize
loadMinimalLoader



Description

Only load current index slide , loadMinimalSize slides
before and after.

Pagination
Prop

Default

Type

Description

showsPagination

true

bool

Set to true make pagination visible.

paginationStyle

{...}

style

Custom styles will merge with the
default styles.
Complete control how to render

renderPagination

-

function

pagination with three params ( index ,
total , context ) ref to
this.state.index / this.state.total

/ this , For example: show numbers
instead of dots.



dotStyle

-

object

Allow custom the active-dot element.

dotColor

-

string

Allow custom the active-dot element.

activeDotColor

-

string

Allow custom the active-dot element.

activeDotStyle

-

object

Allow custom the active-dot element.

Autoplay
https://github.com/leecade/react-native-swiper#installation

7/10

10/4/2019

leecade/react-native-swiper: The best Swiper component for React Native.

Prop

Default

Type

Description

autoplay

true

bool

Set to true enable auto play mode.

autoplayTimeout

2.5

number

autoplayDirection

true

bool

Delay between auto play transitions (in second).
Cycle direction control.

Control buttons
Prop

Default

Type

Description
Set to
true

showsButtons

true

bool

make
control
buttons
visible.

{backgroundColor: 'transparent', flexDirection: 'row',

buttonWrapperStyle

position: 'absolute', top: 0, left: 0, flex: 1,
paddingHorizontal: 10, paddingVertical: 10, justifyContent:

style

Custom
styles.

'space-between', alignItems: 'center'}

Allow
nextButton



element

custom the
next
button.
Allow

prevButton



element

custom the
prev
button.

Props of Children
Prop

Default

Type

Description

style

{...}

style

Custom styles will merge with the default styles.

title

{...}

element

If this parameter is not specified, will not render the title.

Basic props of 
Prop

Default

Type

Description

horizontal

true

bool

If true , the scroll view's children are arranged horizontally in
a row instead of vertically in a column.

pagingEnabled

true

bool

showsHorizontalScrollIndicator

false

bool

Set to true if you want to show horizontal scroll bar.

showsVerticalScrollIndicator

false

bool

Set to true if you want to show vertical scroll bar.

If true, the scroll view stops on multiples of the scroll view's
size when scrolling. This can be used for horizontal pagination.

If true , the scroll view bounces when it reaches the end of
bounces

false

bool

the content if the content is larger then the scroll view along
the axis of the scroll direction. If false , it disables all
bouncing even if the alwaysBounce* props are true.

https://github.com/leecade/react-native-swiper#installation

8/10

10/4/2019

leecade/react-native-swiper: The best Swiper component for React Native.

Prop

Default

Type

Description

scrollsToTop

false

bool

If true, the scroll view scrolls to top when the status bar is
tapped.

removeClippedSubviews

true

bool

If true, offscreen child views (whose overflow value is hidden)
are removed from their native backing superview when
offscreen. This canimprove scrolling performance on long lists.
automaticallyAdjustContentInsets

false

bool

Set to true if you need adjust content insets automation.

scrollEnabled

true

bool

Enables/Disables swiping

@see: http://facebook.github.io/react-native/docs/scrollview.html
Supported ScrollResponder
Prop
onScrollBeginDrag
onMomentumScrollEnd
onTouchStartCapture
onTouchStart
onTouchEnd
onResponderRelease

Params
e / state /
context
e / state /
context
e / state /
context
e / state /
context
e / state /
context
e / state /
context

Type

Description

function

When animation begins after letting up

function

Makes no sense why this occurs first during bounce

function

Immediately after onMomentumScrollEnd

function

Same, but bubble phase

function

You could hold the touch start for a long time

function

When lifting up - you could pause forever before *
lifting

Note: each ScrollResponder be injected with two params: state and context , you can get state and context (ref to
swiper's this ) from params, for example:
var swiper = React.createClass({
_onMomentumScrollEnd: function (e, state, context) {
console.log(state, context.state)
},
render: function() {
return (

)
}
})

More ScrollResponder info, see: https://github.com/facebook/reactnative/blob/master/Libraries/Components/ScrollResponder.js

Methods
scrollBy(index, animated)
Scroll by relative index.
https://github.com/leecade/react-native-swiper#installation

9/10

10/4/2019

leecade/react-native-swiper: The best Swiper component for React Native.

Parameters:
Name

Type

default

Description

index

number

undefined

offset index

bool

true

offset index

animated

Examples
$ cd examples
$ npm i
$ react-native run-ios

Quick start with examples.

Development
$
$
$
$

cd examples
npm i
npm run dev
react-native run-ios

Then launch simulator to preview. Note that you just need to edit the source file src/index.js , the change will auto sync to
examples.
And now that this project follows the standard code style, you'd better prepare it for IDE.

Contribution
@leecade The main author.
@rajkissu The secondary contributor.

Questions
Feel free to contact me or create an issue
Inspired by nolimits4web/Swiper & Design material from Dribbble & made with ♥.

https://github.com/leecade/react-native-swiper#installation

10/10



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.4
Linearized                      : No
Page Count                      : 10
Creator                         : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36
Producer                        : Skia/PDF m73
Create Date                     : 2019:04:10 16:35:18+00:00
Modify Date                     : 2019:04:10 16:35:18+00:00
EXIF Metadata provided by EXIF.tools

Navigation menu