0.1.8 • Published 12 months ago

@renzycode/react-native-fb-photo-grid v0.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

react-native-fb-photo-grid

A React Native component to display photos in a grid like Facebook's newsfeed.

styled with prettier

  • 🔥 Display photos in a Facebook-style grid
  • 🔥 Responsive layout
  • 🔥 Customizable grid and gutter sizes
  • 🔥 Accessible child to parent function

Example: https://github.com/renzycode/react-native-fb-photo-grid-example

Installation

yarn add @renzycode/react-native-fb-photo-grid

or

npm install --save @renzycode/react-native-fb-photo-grid

Usage

import React from 'react';
import { View } from 'react-native';
import FBPhotoGrid from '@renzycode/react-native-fb-photo-grid';

const photos = [
  'https://example.com/photo1.jpg',
  'https://example.com/photo2.jpg',
  'https://example.com/photo3.jpg',
];

const App = () => (
  <View>
    <FBPhotoGrid
      height={400}
      gutterColor="#fff"
      photos={photos}
      gutterSize={2}
      onTouchPhoto={(photoUri, index) => console.log(photoUri, index)}
    />
  </View>
);

export default App;

Props

Prop nameDescriptionTypeDefaultRequired
HeightHeight of the photo gridnumber400false
gutterColorBackground color of the gridstring#ffffalse
photosArray of photo URIsstring[][]true
gutterSizeSize of space between photosnumber0false
onTouchPhotoCallback function when a photo is touched(photoUri: string, index: number) => void()=>{}false

License

MIT

0.1.8

12 months ago

0.1.7

12 months ago

0.1.6

12 months ago

0.1.5

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago