Coder Social home page Coder Social logo

naman2716 / react-native-grid-image-viewer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ansh-099/react-native-grid-image-viewer

0.0 1.0 0.0 370 KB

A grid display for multiple images which you can view on clicking in fullscreen mode and swipe through.

Home Page: https://www.npmjs.com/package/react-native-grid-image-viewer

License: MIT License

JavaScript 45.27% Starlark 7.86% Java 25.47% Ruby 3.27% Objective-C 18.13%

react-native-grid-image-viewer's Introduction

react-native-grid-image-viewer

The Package can be found at react-native-grid-image-viewer.

A grid display for multiple images which you can view on clicking in fullscreen mode and swipe through.

  • Grid Image Viewer
  • Full Screen Mode Image Viewer
  • Max Lightweight Component
  • No Dependency, No Configuration
  • Click on image to view full screen
  • Smooth Animation
  • Swipe image to navigate to next image
  • Available for iOS and Android
  • Also works with Expo

Installation

npm i react-native-grid-image-viewer --save

or

yarn add react-native-grid-image-viewer

Usage

Class component

import React from 'react';
import { View, StyleSheet, Text } from 'react-native';
import GridImageView from 'react-native-grid-image-viewer';

export default class App extends Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
       <View style={styles.background}>
      <Text style={styles.headline_text}>Grid View Images</Text>
      <Text style={styles.explore_text}>Click on an image to view in full screen mode</Text>

      <GridImageView data={[{ image: 'url' }, { image: 'url' }, { image: 'url' }, { image: 'url' }]} />
    </View>
    );
  }
};

const styles = StyleSheet.create({
  background: {
    backgroundColor: 'black',
    flex: 1
  },
  headline_text: {
    color: 'white',
    fontSize: 30,
    fontWeight: 'bold',
    marginTop: 50,
    marginLeft: 20
  },
  explore_text: {
    marginTop: 5,
    marginBottom: 10,
    color: 'white',
    marginLeft: 20,
    fontSize: 12,
    fontWeight: '600'
  },
});

Functional component

import React from 'react';
import { View, StyleSheet, Text } from 'react-native';
import GridImageView from 'react-native-grid-image-viewer';

const App = () => {
  return (
    <View style={styles.background}>
      <Text style={styles.headline_text}>Grid View Images</Text>
      <Text style={styles.explore_text}>Click on an image to view in full screen mode</Text>

      <GridImageView data={[{ image: 'url' }, { image: 'url' }, { image: 'url' }, { image: 'url' }]} />
    </View>
  );
};

const styles = StyleSheet.create({
  background: {
    backgroundColor: 'black',
    flex: 1
  },
  headline_text: {
    color: 'white',
    fontSize: 30,
    fontWeight: 'bold',
    marginTop: 50,
    marginLeft: 20
  },
  explore_text: {
    marginTop: 5,
    marginBottom: 10,
    color: 'white',
    marginLeft: 20,
    fontSize: 12,
    fontWeight: '600'
  },
});

export default App;

Props

Prop Type Description
data array List of images to be displayed in the grid should be in the form: [{image: url1}, {image: url2}, ...]

License

This project is licensed under the MIT License - see LICENSE.md for details

Author

Made by Anshul Singh

react-native-grid-image-viewer's People

Contributors

ansh-099 avatar

Watchers

James Cloos 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.