0.1.8 • Published 1 year ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago