react-native-carousel-image-slider
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

React Native Carousel Image Slider

A simple and fully customizable React Native Carousel Slider component, support to IOS and Android.


Installation

$ npm i --save react-native-carousel-image-slider

OR

$ yarn add react-native-carousel-image-slider

Basic Usage

  • Class Component:

import React from "react";
import { View } from "react-native";
import { CarouselSlider } from "react-native-carousel-image-slider";

export class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      images: [],
    };
  }

  render() {
    return (
      <View style={{ width: "100%", flex: 1, padding: 24 }}>
        <CarouselSlider images={this.state.images} />
      </View>
    );
  }
}
  • Function Component:

import React, { useState } from "react";
import { View } from "react-native";
import { CarouselSlider } from "react-native-carousel-image-slider";

export default function App() {
  const [images, setImages] = useState([]);

  return (
    <View style={{ width: "100%", flex: 1, padding: 24 }}>
      <CarouselSlider images={images} />
    </View>
  );
}

Props

  • images: string[];
  • renderDots?: boolean;
  • onImagePress?: ((event: GestureResponderEvent) => void) | undefined;
  • activeDotColor?: string;
  • inactiveDotColor?: string;
  • dotStyle?: ViewStyle;
  • resizeMethod?: "auto" | "resize" | "scale";
  • resizeMode?: ImageResizeMode;
  • imageStyle?: ImageStyle;
  • disabledOnPress?: boolean;
  • buttonActiveOpacity?: number;

Contributing

  • Fork or clone this repository
  $ git clone https://github.com/GusttavoCastilho/react-native-carousel-image-slider.git

Package Sidebar

Install

npm i react-native-carousel-image-slider

Weekly Downloads

6

Version

1.0.1

License

MIT

Unpacked Size

8.66 kB

Total Files

7

Last publish

Collaborators

  • gustavocvalenciano