mobile-photo-slider
TypeScript icon, indicating that this package has built-in type declarations

1.3.4 • Public • Published

Mobile photo slider - React Native

Mobile photo slider for React Native

Installation

yarn add mobile-photo-slider

Usage

import React, { useState } from "react";
import { Text, TouchableOpacity } from "react-native";

import data from "./data/data";
import Carousel from "mobile-photo-slider";

interface ComponentsProps {
  photos: string[];
}

const Component: React.FC<ComponentsProps> = () => {
  const [open, setOpen] = useState<boolean>(true);

  return (
    <>
      {open && (
        <Carousel
          photos={data}
          primaryColor={"white"}
          secondaryColor={"blue"}
          open={open}
          setOpen={setOpen}
        />
      )}

      {!open && (
        <TouchableOpacity onPress={() => setOpen(true)}>
          <Text>Open</Text>
        </TouchableOpacity>
      )}
    </>
  );
};

export default Component;

Properties

Prop Description Default
primaryColor string related to color none
secondaryColor string related to color none
open boolean associated with modal toogle none
photos Array of string containing url's none
setOpen Function to open and close modal none

Demo

Mobile Photo Slider

Readme

Keywords

none

Package Sidebar

Install

npm i mobile-photo-slider

Weekly Downloads

0

Version

1.3.4

License

none

Unpacked Size

97.3 kB

Total Files

107

Last publish

Collaborators

  • joaovitor32