showing results for - "react native grid view"
Gabriele
30 Apr 2020
1import React from 'react';
2import { StyleSheet, View, Text } from 'react-native';
3import { FlatGrid } from 'react-native-super-grid';
4
5export default function Example() {
6  const [items, setItems] = React.useState([
7    { name: 'TURQUOISE', code: '#1abc9c' },
8    { name: 'EMERALD', code: '#2ecc71' },
9    { name: 'PETER RIVER', code: '#3498db' },
10    { name: 'AMETHYST', code: '#9b59b6' },
11    { name: 'WET ASPHALT', code: '#34495e' },
12    { name: 'GREEN SEA', code: '#16a085' },
13    { name: 'NEPHRITIS', code: '#27ae60' },
14    { name: 'BELIZE HOLE', code: '#2980b9' },
15    { name: 'WISTERIA', code: '#8e44ad' },
16    { name: 'MIDNIGHT BLUE', code: '#2c3e50' },
17    { name: 'SUN FLOWER', code: '#f1c40f' },
18    { name: 'CARROT', code: '#e67e22' },
19    { name: 'ALIZARIN', code: '#e74c3c' },
20    { name: 'CLOUDS', code: '#ecf0f1' },
21    { name: 'CONCRETE', code: '#95a5a6' },
22    { name: 'ORANGE', code: '#f39c12' },
23    { name: 'PUMPKIN', code: '#d35400' },
24    { name: 'POMEGRANATE', code: '#c0392b' },
25    { name: 'SILVER', code: '#bdc3c7' },
26    { name: 'ASBESTOS', code: '#7f8c8d' },
27  ]);
28
29  return (
30    <FlatGrid
31      itemDimension={130}
32      data={items}
33      style={styles.gridView}
34      // staticDimension={300}
35      // fixed
36      spacing={10}
37      renderItem={({ item }) => (
38        <View style={[styles.itemContainer, { backgroundColor: item.code }]}>
39          <Text style={styles.itemName}>{item.name}</Text>
40          <Text style={styles.itemCode}>{item.code}</Text>
41        </View>
42      )}
43    />
44  );
45}
46
47const styles = StyleSheet.create({
48  gridView: {
49    marginTop: 10,
50    flex: 1,
51  },
52  itemContainer: {
53    justifyContent: 'flex-end',
54    borderRadius: 5,
55    padding: 10,
56    height: 150,
57  },
58  itemName: {
59    fontSize: 16,
60    color: '#fff',
61    fontWeight: '600',
62  },
63  itemCode: {
64    fontWeight: '600',
65    fontSize: 12,
66    color: '#fff',
67  },
68});
queries leading to this page
grid react native examplegrid view react nativereact native grid colsreact native grid layountreact native grid componentreact native person gridgrid view react native papermake grid react nativereact native column row gridreact native gridview cardreact native grid viewreact native column gridreact native how to create a gridreact native gridsgrid list react nativereact native responsive gridreact native elements gridgrid in react nativereact native grid layoutreact native grid column and row viewreact native grid reorderreactnative grid layouthow to create grid view in react nativegrid style in react nativegrid box in react nativewhen will display grid come to react nativegridview row react nativecss grid react nativereact native custom gridusing a grid in react nativecustom grid react nativecss grid in react nativereact native grid chartgride react nativecreate grid in react nativehow to use grid in react nativegridview react nativegrid in react native examplereact native display griddynamic grid view in react nativereact native grid view paperreact native gridviewreact native grid cssreact native gridgrid in react native stylesheetreact native box grid viewreact native gridreact native layout gridhow to create a grid in react nativegrid 4 columns react nativereact native grid view layoutdisplay grid in react nativereacr native gridnative grid componentgrid list view react nativegrid screen in react native examplegrid component in react nativegrid view in react nativecan i use grid in react nativegrid view flex react nativereact native grid simplehow to make grid view in react nativestyle grid react nativecreating grid in react nativegrid in react nativcehow to make grid items in react nativegrid use in react native 5dadd grid react nativereact native gride grid react nativereact native display gridreact native griddoes react native support css gridgrid list in react nativereactnative griddisplay a grid react nativegrid layout react nativereact native grid viewreact native responsive griddisplay grid in native base react nativegrid view react nativereact native resizing gridgrid with react nativegridlist react nativeshow grid in react nativegrid view in react native templatehow to create a grid system in reactnativereact native grid list viewreact native css gridgrid for react nativehow to use grid view in react nativehow to make a grid in react nativegrid area react nativereact native create a gridcreate grid in react nativereact native easy gridhow to implement grid view and list view in react nativegrid en react nativegrid install in react nativegrid layout in react nativereact native grid 3freact native grid hookgrid system in react nativereact native custom grid viewdisplay grid in reactnativereact native box gridreact native grid row colreact native display items in gridusing grid in react nativereact native grid listreact native style gridgrids react nativedisplay grid react nativehow to make grid in react native appreact native grid 3egrid view in react native using flatlistlayout with grid react nativegridview in react nativehow to use grid in raect nativereact native grid view npmreact native grid listviewreact native render grid2 grid react nativereact native create gridreact native drax gridreact native grid view layout with api connection react native style display gridreact native element gridreact native generate gridgrid react nativereact native flatlist grid viewreact native can i use gridreact native grid systemreact native grid view