{"id":19495415,"url":"https://github.com/nu-system/react-native-grid","last_synced_at":"2025-04-25T21:32:32.670Z","repository":{"id":57093887,"uuid":"193651369","full_name":"nu-system/react-native-grid","owner":"nu-system","description":"NU 「 no-ui 」 组件库系统 nu-system，Grid 组件 React native 实现","archived":false,"fork":false,"pushed_at":"2019-06-30T10:31:18.000Z","size":15,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T00:34:45.321Z","etag":null,"topics":["grid","grid-react-native","react-native-components","ui-components"],"latest_commit_sha":null,"homepage":"https://nu-system.github.io/react-native/grid/","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/nu-system.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2019-06-25T06:50:42.000Z","updated_at":"2022-12-03T09:22:54.000Z","dependencies_parsed_at":"2022-08-22T21:40:38.389Z","dependency_job_id":null,"html_url":"https://github.com/nu-system/react-native-grid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nu-system%2Freact-native-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nu-system%2Freact-native-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nu-system%2Freact-native-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nu-system%2Freact-native-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nu-system","download_url":"https://codeload.github.com/nu-system/react-native-grid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250900301,"owners_count":21505026,"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":["grid","grid-react-native","react-native-components","ui-components"],"created_at":"2024-11-10T21:37:41.438Z","updated_at":"2025-04-25T21:32:32.433Z","avatar_url":"https://github.com/nu-system.png","language":"JavaScript","readme":"# nu-react-native-grid\n\n[![npm package][npm-badge]][npm]\n\n[npm-badge]: https://img.shields.io/npm/v/npm-package.png?style=flat-square\n[npm]: https://www.npmjs.org/package/@_nu/react-native-grid\n\n这是 NU 「 no-ui 」 组件库系统 nu-system，Grid 组件 React-native 实现。\n\n## 怎么用？\n\n```\nyarn add @_nu/react-native-grid\n```\n\n### 二次封装\n\n```JSX\nimport React from 'react';\nimport Grid from '@_nu/react-native-grid';\n\nconst {Row, Col, Wrap} = new Grid({\n    gridNum: 6,            // 列数\n    gutterInside: 12,      // 内间距宽\n    gutterOutSide: 16      // 外间距宽\n});\n\nexport default Grid;\nexport {Row, Col, Wrap};\n```\n\n### 使用\n\n```JSX\nimport React from 'react';\nimport {StyleSheet, Text, View} from 'react-native';\nimport {Row, Col, Wrap} from \"./components/Grid/index.js\";\n\nexport default function App() {\n    return (\n        \u003cView\u003e\n            \u003cText\u003eHello world\u003c/Text\u003e\n            \u003cWrap\u003e\n                \u003cText style={styles.col}\u003eOpen up App.js to start\u003c/Text\u003e\n            \u003c/Wrap\u003e\n            \u003cRow\u003e\n                \u003cCol span={1}\u003e\u003cText style={styles.col}\u003e1\u003c/Text\u003e\u003c/Col\u003e\n                \u003cCol span={1}\u003e\u003cText style={styles.col}\u003e2\u003c/Text\u003e\u003c/Col\u003e\n                \u003cCol span={1}\u003e\u003cText style={styles.col}\u003e3\u003c/Text\u003e\u003c/Col\u003e\n                \u003cCol span={1}\u003e\u003cText style={styles.col}\u003e4\u003c/Text\u003e\u003c/Col\u003e\n                \u003cCol span={1}\u003e\u003cText style={styles.col}\u003e5\u003c/Text\u003e\u003c/Col\u003e\n                \u003cCol span={1}\u003e\u003cText style={styles.col}\u003e6\u003c/Text\u003e\u003c/Col\u003e\n            \u003c/Row\u003e\n            \u003cRow\u003e\n                \u003cCol span={2}\u003e\u003cText style={styles.col}\u003eHello1\u003c/Text\u003e\u003c/Col\u003e\n                \u003cCol span={2} offset={2}\u003e\u003cText style={styles.col}\u003eHello2\u003c/Text\u003e\u003c/Col\u003e\n                \u003cCol span={4} widthToInt\u003e\u003cText style={styles.col}\u003eHello1\u003c/Text\u003e\u003c/Col\u003e\n                \u003cCol span={2}\u003e\u003cText style={styles.col}\u003eHello1\u003c/Text\u003e\u003c/Col\u003e\n                \u003cCol span={4}\u003e\u003cText style={styles.col}\u003eHello1\u003c/Text\u003e\u003c/Col\u003e\n                \u003cCol span={2}\u003e\u003cText style={styles.col}\u003eHello1\u003c/Text\u003e\u003c/Col\u003e\n            \u003c/Row\u003e\n            \u003cRow\u003e\n                \u003cCol span={3}\u003e\u003cText style={styles.col}\u003eHello1\u003c/Text\u003e\u003c/Col\u003e\n                \u003cCol span={3}\u003e\u003cText style={styles.col}\u003eHello2\u003c/Text\u003e\u003c/Col\u003e\n            \u003c/Row\u003e\n        \u003c/View\u003e\n    );\n}\n```\n\n![demo](./demo.png)\n\n\n### Api `Grid`\n\n| props   |      类型      |       默认值      |  功能 |\n|:----------|:-------------:|:-------------:|------:|\n| gridNum |  number | `6` | 列数 |\n| gutterInside |  number | `12` |  列之间的间距 |\n| gutterOutSide | number  |  `16` | 列距离屏幕边缘的间距 |\n\n\n### Api `Col`\n\n| props   |      类型      |       默认值      |  功能 |\n|:----------|:-------------:|:-------------:|------:|\n| span |  number | `1` | 所占的列数 |\n| offset |  number | `0` |  偏移的列数 |\n| widthToInt | bool  |  `false` | 是否单位采用整数，默认是采用百分比 |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnu-system%2Freact-native-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnu-system%2Freact-native-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnu-system%2Freact-native-grid/lists"}