
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
react-native-layout-grid
Advanced tools
Simple Grid Layout for react-native
$ npm install react-native-layout-grid --save
or use yarn
$ yarn add react-native-layout-grid
The snippet below shows how the component can be used
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Text,
View,
} from 'react-native';
import GridLayout from 'react-native-layout-grid';
export default class App extends Component<{}> {
renderGridItem = (item) => (
<View style={styles.item}>
<View style={styles.flex} />
<Text style={styles.name}>
{item.name}
</Text>
</View>
);
render() {
const items = [];
for (let x = 1; x <= 30; x++) {
items.push({
name: `Grid ${x}`
});
}
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Grid Layout
</Text>
<View style={styles.flex}>
<GridLayout
items={items}
itemsPerRow={3}
renderItem={this.renderGridItem}
/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
marginTop: 20,
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
flex: {
flex: 1,
},
item: {
height: 150,
backgroundColor: '#CCCCCC',
padding: 10,
},
name: {
fontSize: 12,
textAlign: 'center',
color: '#000000'
},
});
Prop | Required | Type | Purpose |
---|---|---|---|
items | Yes | Array | Items to display in Grid |
itemsPerRow | Yes | Number | Number of items on each Grid row |
renderItem | Yes | Function | Single item rendering function |
Contributions are welcome and will be fully credited.
Contributions are accepted via Pull Requests on Github.
Document any change in behaviour - Make sure the README.md
and any other relevant documentation are kept up-to-date.
Consider our release cycle - We try to follow SemVer v2.0.0. Randomly breaking public APIs is not an option.
Create feature branches - Don't ask us to pull from your master branch.
One pull request per feature - If you want to do more than one thing, send multiple pull requests.
Send coherent history - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
Check issues for current issues.
The MIT License (MIT). Please see LICENSE for more information.
FAQs
Simple Grid Layout for react-native
The npm package react-native-layout-grid receives a total of 2 weekly downloads. As such, react-native-layout-grid popularity was classified as not popular.
We found that react-native-layout-grid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.