React Native MantineLayout

SimpleGrid

Auto-responsive grid layout

Import: import { SimpleGrid } from 'react-native-mantine';

Usage

import { SimpleGrid, Paper, Text } from 'react-native-mantine';

<SimpleGrid
  cols={3}
  spacing="md"
  breakpoints={[{ maxWidth: 600, cols: 1 }]}
>
  <Paper p="md"><Text>1</Text></Paper>
  <Paper p="md"><Text>2</Text></Paper>
  <Paper p="md"><Text>3</Text></Paper>
</SimpleGrid>

Props

PropTypeDefaultDescription
colsnumber1Number of columns
spacingMantineNumberSize'md'Spacing between columns and rows
verticalSpacingMantineNumberSizeSpacing between rows, defaults to spacing value
breakpointsArray<{ maxWidth: number; cols: number; spacing?: MantineNumberSize }>Breakpoints for responsive columns
childrenReact.ReactNodeChildren to render in grid
styleanyAdditional styles
testIDstringTest identifier used by testing frameworks

Source on GitHub · npm