@gluestack-ui/网格
安装
用于 @gluestack-ui/grid,你只需要安装
@gluestack-ui/grid 软件包 :
$ yarn add @gluestack-ui/grid
# or
$ npm i @gluestack-ui/grid
使用量
当您需要网格对齐内容时, 网格组件会有所帮助 。 它是一个布局组件,可以与其他组件一起使用来创造复杂的布局和定位.
import { createGrid } from '@gluestack-ui/grid';
import { Parent, Root, Item } from './styled-components';
export const Gridn = createGrid({
Parent,
Root,
Item,
});
自定义网格 :
所有这些组件的默认样式可以在组件/core/grid文件中找到. 作为参考,你可以查看 源代码 样式 grid 组件.
// import the styles
import { Parent, Root, Item } from '../components/core/grid/styled-components';
// import the createGrid function
import { createGrid } from '@gluestack-ui/grid';
// Understanding the API
const Grid = createGrid({
Parent,
Root,
Item,
});
// Using the GRID component
export default () => (
<Grid>
<GridItem></GridItem>
</Grid>
);
更多关于如何启动的指南 这里。 。 。 .