Using Grommet for HPE?See Grid examples and guidance.
Custom label to be used by screen readers. When provided, an aria-label will be added to the element.
string
"a user friendly label for screen readers"
How to align the contents along the cross axis. Any 'align-items' valid CSS value is accepted, including composed ones such 'first baseline' and 'unsafe start'.
string
"start"
"center"
"end"
"baseline"
"stretch
How to align the contents when there is extra space in the cross axis. Any 'align-content' valid CSS value is accepted, including composed ones such 'first baseline' and 'unsafe start'.
string
"around"
"baseline"
"between"
"center"
"evenly"
"end"
"start"
"stretch"
"string"
How to align along the cross axis when contained in a Box or along the column axis when contained in a Grid.
string
"start"
"center"
"end"
"stretch"
"baseline"
Grid areas.
array[object]
Area names and column,row coordinates.
[{ name: "header", start: [0, 0], end: [0, 2] }]
array[array[string]]
An array of string arrays that specify named grid areas.
[ ["header"], ]
The DOM tag or react component to use for the element.
string
The name of a component.
"div"
function
() => {}
Include a border.
boolean
true
false
string
"top"
"left"
"bottom"
"right"
"start"
"end"
"horizontal"
"vertical"
"all"
object
{ color: string | { dark: string, light: string }, size: "medium", style: "solid", side: "all" }
array
An array of objects defining the border for different sides.
[ { color: "black", size: "small", style: "solid", side: "top" }, { color: "black", size: "medium", style: "dotted", side: "bottom" } ]
where size could be:
"xsmall"
"small"
"medium"
"large"
"xlarge"
"any CSS size"
where style could be:
"solid"
"dashed"
"dotted"
"double"
"groove"
"ridge"
"inset"
"outset"
"hidden"
where side could be:
"top"
"left"
"bottom"
"right"
"horizontal"
"vertical"
"all"
Column sizes.
string
Specifying a single string will repeat multiple columns of that size, as long as there is room for more.
"xsmall"
"small"
"medium"
"large"
"xlarge"
"any CSS size"
array
If an array value is an array, the inner array indicates the minimum and maximum sizes for the column.
["small", "..."]
[["small", "medium"], "..."]
where array values could be:
"xsmall"
"small"
"medium"
"large"
"xlarge"
"full"
"flex"
"auto"
"1/2"
"1/3"
"2/3"
"1/4"
"2/4"
"3/4"
object
Specifying an object allows indicating how the columns stretch to fit the available space.
{ count: "fit", size: "..." }
where count could be:
"fit"
"fill"
Whether the width and/or height should fill the container.
string
"horizontal"
"vertical"
boolean
true
false
Gap sizes between rows and/or columns.
string
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"none"
object
{ row: "small", column: "medium" }
A fixed height.
string
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"xxlarge"
"string"
object
{ height: "..." min: "..." max: "..." }
How to align the individual items inside the grid when there is extra space in the row axis.
string
"start"
"center"
"end"
"stretch"
How to align the contents along the row axis.
string
"start"
"center"
"end"
"between"
"around"
"stretch"
The amount of margin around the component.
string
"none"
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
object
Can be specified to distinguish horizontal margin, vertical margin, and margin on a particular side.
{ vertical: "...", horizontal: "...", top: "...", bottom: "...", left: "...", right: "..." }
The amount of padding around the box contents. An object can be specified to distinguish horizontal padding, vertical padding, and padding on a particular side of the box
string
T-shirt sizing based off the theme or a specific size in px, em, etc.
"none"
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"any CSS size"
object
An object can be specified to distinguish horizontal padding, vertical padding, and padding on a particular side.
{ vertical: "...", horizontal: "...", top: "...", bottom: "...", left: "...", right: "...", start: "...", end: "..." }
Row sizes.
string
Specifying a single string will cause automatically added rows to be the specified size.
"xsmall"
"small"
"medium"
"large"
"xlarge"
"any CSS size"
array
If an array value is an array, the inner array indicates the minimum and maximum sizes for the row.
["small", "..."]
[["small", "medium"], "..."]
where array values could be:
"xsmall"
"small"
"medium"
"large"
"xlarge"
"full"
"flex"
"auto"
"1/2"
"1/3"
"2/3"
"1/4"
"2/4"
"3/4"
The DOM tag to use for the element. NOTE: This is deprecated in favor of indicating the DOM tag via the 'as' property.
string
The name of a component.
"div"
function
() => {}
At its core, the Grid component is a regular <div> element. Thus, both DOM and React properties, methods, and events are accessible. To read up on all of the possible DOM attributes and types available for div elements, check out this MDN Web Documents page. To learn more about DOM events and methods, you can read more on the MDN Web Events documentation page.
Also, feel free to read about the types of React events available, or see how DOM attributes change in React. Working in tandem with Styled Components, you also have access to the as property.
The possible sizes for row and column.
object
{ xxsmall: "48px", xsmall: "96px", small: "192px", medium: "384px", large: "768px", xlarge: "1152px", xxlarge: "1536px", full: "100%", }