GithubHelp home page GithubHelp logo

vivek-jm / react-native-animated-gallery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vivekjm/react-native-animated-gallery

0.0 0.0 0.0 51.36 MB

๐Ÿš€ Tiny and fast animated image gallery for react-native

License: MIT License

TypeScript 40.12% JavaScript 3.61% Starlark 2.80% Java 29.00% Objective-C 20.99% Ruby 3.47%

react-native-animated-gallery's Introduction

React Native Animated Gallery

npm npm

๐Ÿš€ Tiny and fast animated image gallery for react-native

ย ย ย ย ย ย ย ย ย ย ย 

Getting started

npm i react-native-animated-gallery --save

or

yarn add react-native-animated-gallery

iOS

No additional step is required.

Android

No additional step is required.

Usage

First of all, import the component.

import AnimatedGallery from "react-native-animated-gallery";

Then use it like this.

import * as React from "react";
import { Text, View } from "react-native";
import AnimatedGallery from "react-native-animated-gallery";

export default () => {
  const images = [
    {
      id: 1,
      url: "https://images.pexels.com/photos/2347011/pexels-photo-2347011.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800",
    },
    {
      id: 2,
      url: "https://images.pexels.com/photos/2387877/pexels-photo-2387877.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800",
    },
    {
      id: 3,
      url: "https://images.pexels.com/photos/1624360/pexels-photo-1624360.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800",
    },
  ];

  const Loader = () => {
    return (
      <View style={{ justifyContent: "center", alignItems: "center", flex: 1 }}>
        <Text>Custom Loader..</Text>
      </View>
    );
  };

  return (
    <View style={{ flex: 1, backgroundColor: "#fff" }}>
      <AnimatedGallery
        imageUrls={images}
        renderLoader={<Loader />}
        disablefullScreen={false}
        thumpBorderWidth={3}
        thumpBorderColor={"white"}
        spacing={8}
        imageSize={90}
        backgroundColor={"#0000"}
        onEndReached={() => {
          console.log("End reached");
        }}
        invertThumpDirection={false}
        invertGalleryDirection={false}
      />
    </View>
  );
};

Props


Reference

Props

imageUrls

Provides Data to the component

Type Required
Array yes

renderLoader

Custom loader for component

Type Required
ReactElement no

imageSize

Set the size of the thump nail to square proprtion

Type Required
imageSize number

spacing

Set the sapcing between thump nail.

Type Required
spacing number

thumpBorderWidth

Set the border width for thump nail.

Type Required
number No

thumpBorderColor

Set the border color for thump nail

Type Required
string No

disablefullScreen

Disable the fullscreen view of image

Type Required
boolean No

backgroundColor

Set the backgroundColor for gallery when not in fullscreen mode

Type Required
string No

onEndReached

Called when all rows have been rendered and the list has been scrolled to within onEndReachedThreshold of the bottom. The native scroll event is provided.

Type Required
function No

invertThumpDirection

Reverses the direction of scroll. Uses scale transforms of -1.

Type Required
boolean No

invertThumpDirection

Reverses the direction of scroll of gallery. Uses scale transforms of -1.

Type Required
boolean No

react-native-animated-gallery's People

Contributors

vivekjm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.