All Projects → hyochan → react-native-masonry-list

hyochan / react-native-masonry-list

Licence: MIT license
The Masonry List implementation which has similar implementation as the `FlatList` in React Native

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to react-native-masonry-list

Justified Gallery
Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
Stars: ✭ 1,512 (+492.94%)
Mutual labels:  masonry, masonry-layout
angular-masonry
A simple lightweight library to use Masonry layout in Angular
Stars: ✭ 11 (-95.69%)
Mutual labels:  masonry, masonry-layout
react-plock
Plock is a responsive masonry layout implementation for React.
Stars: ✭ 118 (-53.73%)
Mutual labels:  masonry, masonry-layout
React Native Masonry
🙌 A pure JS react-native component to render a masonry~ish layout for images with support for dynamic columns, progressive image loading, device rotation, on-press handlers, and headers/captions.
Stars: ✭ 1,094 (+329.02%)
Mutual labels:  masonry
Screenadaptationkit
🎨iOS rapidScreen Compatible AdapterKit(Deprecate)
Stars: ✭ 70 (-72.55%)
Mutual labels:  masonry
Niui
Lightweight, feature-rich, accessible front-end library
Stars: ✭ 152 (-40.39%)
Mutual labels:  masonry
egjs-grid
A component that can arrange items according to the type of grids
Stars: ✭ 188 (-26.27%)
Mutual labels:  masonry
Lcactionsheet
一款简约而不失强大的 ActionSheet,微博、微信和 QQ 都采用了极其类似的样式,完全支持 Swift。
Stars: ✭ 809 (+217.25%)
Mutual labels:  masonry
Ragrid
Intrinsic first auto-layout flexbox grid
Stars: ✭ 249 (-2.35%)
Mutual labels:  masonry
Savvior
A Salvattore and Masonry alternative without CSS-driven configuration or absolute CSS positioning
Stars: ✭ 122 (-52.16%)
Mutual labels:  masonry
Masonic
🧱 High-performance masonry layouts for React
Stars: ✭ 209 (-18.04%)
Mutual labels:  masonry
Flexlib
FlexLib是一个基于flexbox模型,使用xml文件进行界面布局的框架,融合了web快速布局的能力,让iOS界面开发像写网页一样简单快速
Stars: ✭ 1,569 (+515.29%)
Mutual labels:  masonry
Vue Masonry Wall
A pure vue responsive masonry layout without direct dom manipulation and ssr support.
Stars: ✭ 79 (-69.02%)
Mutual labels:  masonry
Vue Magic Grid
🧙‍♂️🔌 Responsive Magic Grid for Vue
Stars: ✭ 162 (-36.47%)
Mutual labels:  masonry
React Xmasonry
Simple, minimalistic and featured native masonry layout for React JS.
Stars: ✭ 62 (-75.69%)
Mutual labels:  masonry
React Snuggle
An intimate and comfortable way to layout your components
Stars: ✭ 251 (-1.57%)
Mutual labels:  masonry
Masonry Layout
An efficient and fast web component that gives you a beautiful masonry layout
Stars: ✭ 43 (-83.14%)
Mutual labels:  masonry
Opensource
♨️ 分享GitHub优秀开源项目和主流开发使用的网站、解决问题方案收集以及学习网站或资料,涵盖了iOS, macOS X, Blockchain, Flutter, Weex, H5, Games, C++, Script等多方面的内容,其中iOS大致包涵以下内容:音视频;IM和直播;逆向开发;图像相关(OpenGL, Metal, GPUImage);内购(IAP), ApplePay和第三方支付;安全攻防和应用加固, 数据安全和算法;常用第三方库;导航栏和状态栏;侧边菜单;数据持久;蓝牙, 手势指纹面容ID解锁, 图片浏览器, 扫码, 下拉和上拉刷新, 指示器, Toast, Menu, Sensor, Privacy, WebView和进度条, 动画, 选择器, 搜索, 分享, 图片验证码, 设备相关信息, 广告, 高仿项目及Demo等。
Stars: ✭ 123 (-51.76%)
Mutual labels:  masonry
react-mason
React Masonry grid
Stars: ✭ 13 (-94.9%)
Mutual labels:  masonry
Ngx Masonry
Angular Module for displaying a feed of items in a masonry layout
Stars: ✭ 102 (-60%)
Mutual labels:  masonry

react-native-masonry-list

Pinterest like listview made in React Native. It just behaves like the FlatList so it is easy to use.

Npm Version Downloads CI codecov code style: prettier LICENSE PRs Welcome supports iOS supports Android supports web runs with expo

Notice

If you want react-native-reanimated version, you may checkout reanimated-masonry-list. This repo is created with issue #14.

Installation

yarn add @react-native-seoul/masonry-list
import MasonryList from '@react-native-seoul/masonry-list';

Preview

2-columns 3-columns 4-columns

You can use as many columns as you want. It is flexible!

YouTube

See how to use it

Blog

How it is made

Description

Current MasonryList extends ScrollView and can pass down its props. Indeed, this looks similar to FlatList to provide good developer experience. Look how this is used and compare to the FlatList.

The FlatList won't offer you to draw MansonryList because when you provide numColumns bigger than 1, the native view will switch to FlatList to GridView which will render its children with identical height only.

Our MasonryList view component is able to render all child views with all different sizes.

Props

innerRef?: MutableRefObject<ScrollView | undefined>;
loading?: boolean;
refreshing?: RefreshControlProps['refreshing'];
onRefresh?: RefreshControlProps['onRefresh'];
onEndReached?: () => void;
onEndReachedThreshold?: number;
style?: StyleProp<ScrollViewProps>;
data: T[];
renderItem: ({item: T, i: number}) => ReactElement;
LoadingView?: React.ComponentType<any> | React.ReactElement | null;
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null;
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null;
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null;
numColumns?: number;
keyExtractor?: ((item: T | any, index: number) => string) | undefined;

innerRef - Expose ScrollView instance with ref, example usage: ref.current.scrollTo.

loading - Currently in loading status.

refreshing - Currently in refreshing status.

onRefresh - Callback when refresh has been triggered.

onEndReached - Callback when end is reached just like the onEndReached in FlatList

style - Style props for ScrollView which is the container view.

data - The array of the data for the view to render in renderItem

renderItem - Render custom view with the data passed down.

LoadingView - Custom loading view when the view is in loading status.

ListHeaderComponent - Header component

ListFooterComponent - Footer component

ListEmptyComponent - Component to render when the data is empty.

numColumns - Number of columns you want to render. Default to 2.

Usage

<MasonryList
  data={filteredItems}
  keyExtractor={(item): string => item.id}
  numColumns={2}
  showsVerticalScrollIndicator={false}
  renderItem={({item}) => <CardItem />}
  refreshing={isLoadingNext}
  onRefresh={() => refetch({first: ITEM_CNT})}
  onEndReachedThreshold={0.1}
  onEndReached={() => loadNext(ITEM_CNT)}
/>

Run Example

  1. Clone the repository.

    git clone https://github.com/hyochan/react-native-masonry-list.git
    
  2. Navigate to example project

    cd RNMasonryExample
    
  3. Install packages and run it as you do in react-native project.

LICENSE

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].