React Native Swiper Component

1.6.0 · active · verified Tue Apr 21

react-native-swiper is a widely used, feature-rich swiper/carousel component designed for React Native applications. As of its latest stable release, v1.6.0, it provides a highly customizable solution for displaying paginated content, supporting both iOS and Android platforms. The library focuses on providing a smooth user experience with features like autoplay, infinite looping, flexible pagination dots, and lazy loading for performance optimization via `loadMinimal`. It supports TypeScript out-of-the-box, shipping with correct type definitions, and has recently moved away from `ViewPagerAndroid` to `ScrollView` for improved compatibility and reduced dependency footprint. The project maintains an active development pace with consistent bug fixes and new features, though no strict release cadence is formally documented. Its key differentiators include extensive prop-based customization for styling and behavior, robust platform support, and a history of addressing common React Native carousel challenges.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates a basic `Swiper` component with three slides, infinite loop, autoplay, and navigation buttons.

import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import Swiper from 'react-native-swiper';

const App = () => {
  return (
    <Swiper style={styles.wrapper} showsButtons loop autoplay>
      <View style={styles.slide1}>
        <Text style={styles.text}>Hello Swiper</Text>
      </View>
      <View style={styles.slide2}>
        <Text style={styles.text}>Beautiful</Text>
      </View>
      <View style={styles.slide3}>
        <Text style={styles.text}>And simple</Text>
      </View>
    </Swiper>
  );
};

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 App;

view raw JSON →