New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@appandflow/masonry-list

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appandflow/masonry-list

[![npm (scoped)](https://img.shields.io/npm/v/@appandflow/masonry-list.svg)](https://www.npmjs.com/package/@appandflow/masonry-list) [![Travis branch](https://img.shields.io/travis/AppAndFlow/react-native-masonry-list/master.svg)](https://travis-ci.org/Ap

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
128
increased by116.95%
Maintainers
3
Weekly downloads
 
Created
Source

@appandflow/masonry-list

npm (scoped) Travis branch

Allows creating masonry style list layouts in a performant way.

This component leverages FlatList to render performant masonry layout lists. The main caveat right now is that it doesn't support measuring cells (yet) so you need to be able to provide the dimensions.

Installation

yarn add @appandflow/masonry-list

Usage

import MasonryList from '@appandflow/masonry-list';

Props

This component supports most of the props of FlatList plus a few extras one:

getHeightForItem: ({ item: any, index: number }) => number,

Returns the height for a specific item. Note that this it not optional for now.

numColumns: number

The number of columns.

renderItem: ({ item: any, index: number, column: number }) => ?ReactElement<*>,

Same as renderItem from FlatList but also gets passed the column index.

Example

Play with on Expo

Take a look at example folder

TODO

  • Support measuring items automatically and get rid of getHeightForItem.

  • Implement onEndReached in a way that it isn't called multiple times.

  • Support FooterComponent.

  • Long term, could probably be implemented without using multiple VirtualizedList to make it more performant and less hacky.

Keywords

FAQs

Package last updated on 26 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc