Gathering detailed insights and metrics for react-native-masonry
Gathering detailed insights and metrics for react-native-masonry
Gathering detailed insights and metrics for react-native-masonry
Gathering detailed insights and metrics for react-native-masonry
@react-native-seoul/masonry-list
React Native Masonry List for Pinterest like UI implemented just like the [FlatList].
react-native-masonry-list
An easy and simple to use React Native component to render a custom high performant masonry layout for images. It uses a smart algorithm to sort the images evenly as possible according to the index position or fill in as soon as the image is fetched. In
@danielprr-react-native/animated-scrollview-masonry-list
React Native Masonry List for Pinterest like UI implemented just like the [FlatList].
react-native-masonry-gridview
A React Native component for rendering a masonry layout of items in columns.
🙌 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.
npm install react-native-masonry
Typescript
Module System
Node Version
NPM Version
JavaScript (78.92%)
Objective-C (12.33%)
Python (4.82%)
Java (3.93%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1,344 Stars
154 Commits
157 Forks
12 Watchers
25 Branches
11 Contributors
Updated on Jul 08, 2025
Latest Version
0.5.0-alpha.5
Package Id
react-native-masonry@0.5.0-alpha.5
Unpacked Size
26.94 kB
Size
9.12 kB
File Count
9
NPM Version
5.6.0
Node Version
10.1.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
:raised_hands: An easy to use, pure JS react-native component to render a masonry~ish layout for remote images
react-native-masonry
is built with the following features and functionalities baked in 🍰:
1$ npm install --save react-native-masonry
1import Masonry from 'react-native-masonry';
1<Masonry 2 sorted // optional - Default: false 3 columns={4} // optional - Default: 2 4 bricks={[ 5 { uri: 'http://image1.jpg' }, 6 { uri: 'http://image2.jpg' }, 7 { uri: 'http://image3.jpg' } 8 ]} 9/>
Props | Type | Description | Default |
---|---|---|---|
bricks | array | A list of Object:Bricks to be passed into the row renderer. I.E:,bricks=[{id: 1, uri: 'https://image.jpg', onPress: (brick) => this.redirect(brick.id)}, {id: 2, uri: 'https://hyper.jpg'}] | [] |
columns | num | Desired number of columns | 2 |
sorted | bool | Whether to sort bricks according to their index position or allow bricks to fill in as soon as the uri is ready. | false |
imageContainerStyle | object | The styles object which is added to the Image component | {} |
customImageComponent | React.Component | Use a custom component to be rendered for the Image. This will work properly, as long as the component follows the standard interface of the react-native image component. | n/a |
customImageProps | object | Pass along additional properties to a props.customImageComponent . | n/a |
spacing | num | Gutter size of the column. The spacing is a multiplier of 1% of the available view. | 1 |
refreshControl | React.Component | A component to be used as a refresh element for the Masonry component | n/a |
"Bricks" are the basic building block of the masonry and are passed into the props.bricks. They essentially represent the items within each column and require a uri
property at a minimum. However, you can freely add additional properties to the data
property if you need access to certain data within your brick.onPress
handler and footer/header
renderer. The following properties are available.
Property | Type | Required | Description | Example |
---|---|---|---|---|
uri | string | ✅ | The uri of the image location. | http://test.com/i.jpeg |
key | string | 🚫 | Optional item key. By default, uri is used as the key for each item. It's recommended to set a unique key here, but it is not required. The key is required if you need to have image with the same uri more than once in your list. | image01 |
onPress | func (brick.data) | 🚫 | A function handler when the brick is pressed. The function will be called with the instance of the brick, which provides it's dimensions, columns, as well as any user defined properties passed into the bricks prop. An image will be wrapped by a TouchableHighlight . | onPress: (data) => goTo(data.id) |
renderHeader | func (brick.data) | 🚫 | A function that is executed ABOVE the brick image, this function must return a React Component. renderHeader() is passed brick.data to allow dynamic content rendering of components. | Figure 1 |
renderFooter | func (brick.data) | 🚫 | A function that is executed BELOW the brick image renderFooter() is passed brick.data to allow dynamic content rendering of components. | Figure 2 |
ℹ️ Figure 1: Brick with renderHeader
Accomplishing a top bar indicating the user's avatar and name
1{ 2 // User defined data 3 data: { 4 user: { 5 name: 'Henry', 6 profilePic: 'https://user.jpeg' 7 } 8 } 9 uri: 'https://example.com/mainImage.jpeg', 10 renderHeader: (data) => { 11 return ( 12 <View> 13 <Image source={{ uri: data.user.profilePic }} style={{ width: 50, height: 50}}> 14 <Text>{data.user.name}</Text> 15 </View> 16 ); 17 } 18}
ℹ️ Figure 2: Brick with .renderFooter
Creating a bottom bar to include additional metadata
1{ 2 data: { 3 caption: 'Summer Recipies' 4 }, 5 uri: 'https://example.com/mainImage.jpeg', 6 renderFooter: (data) => { 7 return ( 8 <View> 9 <Text>{data.caption}</Text> 10 </View> 11 ); 12 } 13}
ℹ️ Figure 3: Using Third-Party Image Components
How to leverage third-party components like
<FastImage>
and apply unique properties across all images
1import FastImage from 'react-native-fast-image'; 2 3const fastProps = { 4 onProgress: { e => console.log(e.nativeEvent.loaded / e.nativeEvent.total) }, 5 resizeMode: FastImage.resizeMode.contain 6}; 7 8// ... Where Masonry is called 9<Masonry 10 bricks={data} 11 customImageComponent={FastImage} 12 customImageProps={fastProps} />
Pull requests are welcomed, just abide by rules listed within contributing.json.
Not sure where to start, or a beginner? Take a look at the issues page for low-hanging
or beginner-friendly
labels as an easy ways to start contributing.
Thank you to all the people who have already contributed to react-native-masonry!
MIT © Brandon Him
No vulnerabilities found.
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 4/16 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
89 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More