{"id":4082,"url":"https://github.com/phil-r/react-native-grid-component","last_synced_at":"2025-04-05T00:08:22.712Z","repository":{"id":10971709,"uuid":"67309139","full_name":"phil-r/react-native-grid-component","owner":"phil-r","description":":black_square_button: React native grid component","archived":false,"fork":false,"pushed_at":"2022-12-06T15:56:16.000Z","size":1199,"stargazers_count":265,"open_issues_count":36,"forks_count":30,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T23:07:42.680Z","etag":null,"topics":["android","grid","grid-component","ios","react","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phil-r.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-03T19:58:59.000Z","updated_at":"2024-03-13T07:17:08.000Z","dependencies_parsed_at":"2023-01-13T16:24:52.918Z","dependency_job_id":null,"html_url":"https://github.com/phil-r/react-native-grid-component","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil-r%2Freact-native-grid-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil-r%2Freact-native-grid-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil-r%2Freact-native-grid-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil-r%2Freact-native-grid-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phil-r","download_url":"https://codeload.github.com/phil-r/react-native-grid-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266564,"owners_count":20910836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","grid","grid-component","ios","react","react-native"],"created_at":"2024-01-05T20:17:00.522Z","updated_at":"2025-04-05T00:08:22.696Z","avatar_url":"https://github.com/phil-r.png","language":"JavaScript","funding_links":[],"categories":["Components","Index","JavaScript","Others"],"sub_categories":["UI","Custom Components and Cool Shit"],"readme":"# :black_square_button: react-native-grid-component\n\n[![NPM version](http://img.shields.io/npm/v/react-native-grid-component.svg?style=flat)](https://www.npmjs.com/package/react-native-grid-component)\n[![Build Status](https://travis-ci.org/phil-r/react-native-grid-component.svg?branch=master)](https://travis-ci.org/phil-r/react-native-grid-component)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\nEasy to use grid component for your [react-native](https://github.com/facebook/react-native/) project. Supports iOS and Android.\n\nBased on [react-native framework](https://github.com/facebook/react-native/) by Facebook.\n\n## Installation\n\n```\nnpm install react-native-grid-component\n```\n\nor\n\n```\nyarn add react-native-grid-component\n```\n\n## Examples\n\n- [Simple](https://snack.expo.io/@phil/react-native-grid-component-example)\n- [Sections](https://snack.expo.io/@phil/grid-with-sections-example)\n\n## Demo\n\n![android low](https://cloud.githubusercontent.com/assets/577316/18456263/d6b977e2-794f-11e6-878f-5737355111ac.gif) ![ios low](https://cloud.githubusercontent.com/assets/577316/18456262/d6b7a39a-794f-11e6-8587-06757dc42e14.gif)\n\n## Usage\n\n```js\nimport React, { Component } from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport Grid from 'react-native-grid-component';\n\nclass Simple extends Component {\n  _renderItem = (data, i) =\u003e (\n    \u003cView style={[{ backgroundColor: data }, styles.item]} key={i} /\u003e\n  );\n\n  _renderPlaceholder = i =\u003e \u003cView style={styles.item} key={i} /\u003e;\n\n  render() {\n    return (\n      \u003cGrid\n        style={styles.list}\n        renderItem={this._renderItem}\n        renderPlaceholder={this._renderPlaceholder}\n        data={['black', 'white', 'red', 'green', 'blue']}\n        numColumns={2}\n      /\u003e\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  item: {\n    flex: 1,\n    height: 160,\n    margin: 1\n  },\n  list: {\n    flex: 1\n  }\n});\n```\n\n[Full interactive example](https://snack.expo.io/@phil/react-native-grid-component-example)\n\n## Props\n\n| Name                           | propType                                       | description                                                                                                 |\n| ------------------------------ | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |\n| `data` _required_              | Array                                          | Array that will be used to render items                                                                     |\n| `renderItem` _required_        | func `(data: any, i: number) =\u003e React$Element` | function that accepts data and returns React Element that will be rendered for each `data` item             |\n| `renderPlaceholder` _optional_ | func `(i: number) =\u003e React$Element`            | function that returns placeholder React Elements that ere rendered to fill the space at the end of the grid |\n| `numColumns` _optional_        | number                                         | number of elements per one row                                                                              |\n| `keyExtractor` _optional_      | func `(item: object, index: number) =\u003e string` | [see docs](https://facebook.github.io/react-native/docs/flatlist#keyextractor)                              |\n| `sections` _optional_          | bool                                           | switches internal implementation to [SectionList](https://facebook.github.io/react-native/docs/sectionlist) |\n\nAlso see [FlatList](https://facebook.github.io/react-native/docs/flatlist#props) props or [SectionList](https://facebook.github.io/react-native/docs/sectionlist#props) props(if you set `sections` to true)\n\n## See also\n\n- [React Native Looped Carousel](https://github.com/appintheair/react-native-looped-carousel)\n- [React Native Buyscreen](https://github.com/appintheair/react-native-buyscreen)\n\n## ISC License (ISC)\n\nCopyright (c) 2016-2019, Phil Rukin \u003cmailto:\u003cphilipp@rukin.me\u003e\u003e\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphil-r%2Freact-native-grid-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphil-r%2Freact-native-grid-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphil-r%2Freact-native-grid-component/lists"}