The best Swiper component for React Native.
The best Swiper component for React Native.
The best Swiper component for React Native.
see: ROADMAP.md
[1.5.6]
[1.5.5]
[1.5.4]
dotColor / activeDotColor and dotStyle / activeDotStyle (thanks @denizs)[1.5.3]
[1.5.2]
see more: CHANGELOG.md
Try these cases by yourself very easy, Just open
examples/ios/swiper.xcodeprojin Xcode, then pressCmd + R; you may editexamples/index.ios.jsfor switch cases.
v1.5.14
$ npm i react-native-swiper --savev1.6.0-rc
npm i --save react-native-swiper@nextreact-native first$ npm i react-native-cli -g$ react-native init myprojectmyproject/index.ios.js, like this:…| 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. |
| loop | true | bool |
Set to false to disable continuous loop mode. |
| index | 0 | number |
Index number of initial slide. |
| showsButtons | false | bool |
Set to true make control buttons visible. |
| autoplay | false | bool |
Set to true enable auto play mode. |
| onIndexChanged | (index) => null | func |
Called with the new index when the user swiped |
| Prop | Default | Type | Description |
|---|---|---|---|
| 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. |
| loadMinimal | false | bool |
Only load current index slide , loadMinimalSize slides before and after. |
| loadMinimalSize | 1 | number |
see loadMinimal |
| loadMinimalLoader | <ActivityIndicator /> |
element |
Custom loader to display when slides aren't loaded |
| Prop | Default | Type | Description |
|---|---|---|---|
| showsPagination | true | bool |
Set to true make pagination visible. |
| paginationStyle | {...} | style |
Custom styles will merge with the default styles. |
| renderPagination | - | function |
Complete control how to render pagination with three params (index, total, context) ref to this.state.index / this.state.total / this, For example: show numbers instead of dots. |
| dot | <View style={{backgroundColor:'rgba(0,0,0,.2)', width: 8, height: 8,borderRadius: 4, marginLeft: 3, marginRight: 3, marginTop: 3, marginBottom: 3,}} /> |
element |
Allow custom the dot element. |
| activeDot | <View style={{backgroundColor: '#007aff', width: 8, height: 8, borderRadius: 4, marginLeft: 3, marginRight: 3, marginTop: 3, marginBottom: 3,}} /> |
element |
Allow custom the active-dot element. |
| dotStyle | - | object |
Allow custom the dot element. |
| dotColor | - | string |
Allow custom the dot element. |
| activeDotColor | - | string |
Allow custom the active-dot element. |
| activeDotStyle | - | object |
Allow custom the active-dot element. |
| Prop | Default | Type | Description |
|---|---|---|---|
| autoplay | true | bool |
Set to true enable auto play mode. |
| autoplayTimeout | 2.5 | number |
Delay between auto play transitions (in |
onIndexChanged getting wrong value
Swiper cuts off after state update on another page
onIndexChanged not called, wrong screen rendered
2.0.x Iteration Discussion
Cannot read property "commands" of null
Swiper is Re-Rendering after loop is completed
how to detect swipe left or right
Pagination dots change are kind of slow
the loadMinimal logic may have a mistake
Just don't use this lib.