Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-native-swiper

> 前端框架
Open source

The best Swiper component for React Native.

10.5K stars0 likes3 views
WebsiteGitHub

About

The best Swiper component for React Native.

The best Swiper component for React Native.

react-native-swiper

Roadmap

see: ROADMAP.md

Changelogs

  • [1.6.0-rc]
    • Dependency
      • Remove ViewPagerAndroid, use ScrollView #1009
    • Test Integration
      • Setup e2e test
    • TypeScript
      • correct the wrong types #1000
      • Add missing scrollBy TypeScript definition #931
    • New Feature
      • add scrollTo #831
      • Added prop to disable the PrevButton #749
      • Optionally render page #1004
    • Bug Fix
      • ES6 and CommonJS compatibility #717
      • Solves the issue of state messing up when parent component calls setState #939
      • replay when autoplay is setted to true #1002
      • fix broken examples and migrate to react-native 0.60.x
      • fix bad jumping on ios when loadMinimal set true
      • fix fliker when loop and loadMinimal are enabled #1062
  • [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 <ActivityIndicator /> (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.

examples/components/Basic

examples/components/Swiper

examples/components/SwiperNumber

examples/components/Phone

examples/components/LoadMinimal

Getting Started

  • Installation
  • Basic Usage
  • Properties
    • Basic
    • Custom basic style & content
    • Pagination
    • Autoplay
    • Control buttons
    • Props of Children
    • Basic props of <ScrollView />
    • Supported ScrollResponder
  • Examples
  • Development

Installation

v1.5.14

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

v1.6.0-rc

bash
npm i --save react-native-swiper@next

Basic Usage

  • Install react-native first
bash
$ npm i react-native-cli -g
  • Initialization of a react-native project
bash
$ react-native init myproject
  • Then, edit myproject/index.ios.js, like this:
…

Properties

Basic

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

Custom basic style & content

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

Pagination

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.

Autoplay

Prop Default Type Description
autoplay true bool Set to true enable auto play mode.
autoplayTimeout 2.5 number Delay between auto play transitions (in

Issues· 777 open

View all issuesOpen on GitHub
  • #1371

    onIndexChanged getting wrong value

    Updated Aug 22, 2025
  • #1215

    Swiper cuts off after state update on another page

    Updated May 13, 2025
  • #503

    onIndexChanged not called, wrong screen rendered

    Need answer from authorUpdated Apr 25, 2025
  • #1169

    2.0.x Iteration Discussion

    Updated Mar 18, 2025
  • #1316

    Cannot read property "commands" of null

    Updated Mar 17, 2025
  • #1287

    Swiper is Re-Rendering after loop is completed

    Updated Mar 12, 2025
  • #1351

    how to detect swipe left or right

    Updated Feb 7, 2025
  • #725

    Pagination dots change are kind of slow

    Updated Dec 16, 2024
  • #1374

    the loadMinimal logic may have a mistake

    Updated Nov 29, 2024
  • #1364

    Just don't use this lib.

    Updated Oct 30, 2024

> Tags

JavaScriptreactreact-nativeswipe

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架