Grid is a 2-dimensional layout system, meaning that it can handle both
columns and rows, that helps you design grid-based user interfaces, unlike
<Stack>
which is largely a 1-dimensional system.
Usage
import { Grid } from 'nr1'
Examples
Basic
ReferenceError: Grid is not defined
Medium gap type
ReferenceError: Grid is not defined
Small gap type
ReferenceError: Grid is not defined
Columns
ReferenceError: Grid is not defined
Collapse gap
ReferenceError: Grid is not defined
Props
childrenrequirednode
Grid items to display.
Up to 12 items are allowed.
classNamestring
Appends class names to the component.
Should be used only for positioning and spacing purposes.
gapTypeenum
DEFAULT
Grid .GAP_TYPE .MEDIUM
Size of the gap between columns and rows.
<One ofGrid.GAP_TYPE.MEDIUM,Grid.GAP_TYPE.SMALL,>
spacingTypeenum[]
Spacing property. Spacing is defined as a tuple of zero to four
values, which follow the same conventions as CSS properties like
margin
or padding
. To omit a value, use SPACING_TYPE.OMIT
.
<Array of<One ofGrid.SPACING_TYPE.EXTRA_LARGE,Grid.SPACING_TYPE.LARGE,Grid.SPACING_TYPE.MEDIUM,Grid.SPACING_TYPE.NONE,Grid.SPACING_TYPE.OMIT,Grid.SPACING_TYPE.SMALL,>
>
styleobject
Inline style for custom styling.
Should be used only for positioning and spacing purposes.
testIdstring
Adds a data-test-id
.
Used to target the component in unit and e2e testing.
Methods
Grid.render
function () => undefined