The grid area component allows you to position and size a content area nested within a q2-grid component. Grid areas can span multiple columns and rows within a grid and can even overlap other grid area components.
q2-grid-area component(s) should always comprise the immediate children elements of a q2-grid component.
Slotted text content may inherit the alignment properties of the grid or grid area components, resulting in unexpected text alignment outcomes. To prevent this from occurring, use flebox or text-align properties within your slotted content's styling to control this behavior.
If you use the column-span attribute to span more columns than are available in the grid, the parent q2-grid component will automatically add additional columns to accommodate the q2-grid-area component. This behavior is intentional and allows for flexible grid layouts.
NOTE: While the amount of columns and rows you can examine in the code examples has been limited, q2-grid supports any number of columns and rows! Usage of background colors and bordering have been added to code examples for visual clarity only. You should most likely remove these styles when implementing the grid component for your specific needs.
The q2-grid component uses the current window to determine the viewport size. If your feature is rendering inside an extension/iframe, the breakpoints will be based on the iframe's size, not the whole browser. For example, the Landing Page in online banking has a max content width of 768px on desktop due to the presence of the side-rail menu (which has a width of 255px), while the Composable Dashboard page has a max content width of 1024px because the side-rail menu is not present there.


The breakpoint sizes for reference, are:
• Extra Small (xs): 480px+
• Small (sm): 768px+
• Medium (md): 992px+
• Large (lg): 1200px+
• Extra Large (xl): 1400px+
<div style="width: 33.33%; height: 33.33%; aspect-ratio: 1 / 1;">
<q2-grid
columns="12"
rows="12"
gap="none"
>
<q2-grid-area
column-start="1"
column-span="1"
row-start="1"
row-span="1"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="4"
column-span="2"
row-start="1"
row-span="1"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="8"
column-span="2"
row-start="1"
row-span="1"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="12"
column-span="1"
row-start="1"
row-span="1"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="1"
column-span="1"
row-start="4"
row-span="2"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="4"
column-span="2"
row-start="4"
row-span="2"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="8"
column-span="2"
row-start="4"
row-span="2"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="12"
column-span="1"
row-start="4"
row-span="2"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="1"
column-span="1"
row-start="8"
row-span="2"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="4"
column-span="2"
row-start="8"
row-span="2"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="8"
column-span="2"
row-start="8"
row-span="2"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="12"
column-span="1"
row-start="8"
row-span="2"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="1"
column-span="1"
row-start="12"
row-span="1"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="4"
column-span="2"
row-start="12"
row-span="1"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="8"
column-span="2"
row-start="12"
row-span="1"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="12"
column-span="1"
row-start="12"
row-span="1"
z-index="1"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #02b3d8;"></div
></q2-grid-area>
<q2-grid-area
column-start="1"
column-span="4"
row-start="1"
row-span="4"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #c9f0f8;"></div
></q2-grid-area>
<q2-grid-area
column-start="5"
column-span="4"
row-start="1"
row-span="4"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #c9f0f8;"></div
></q2-grid-area>
<q2-grid-area
column-start="9"
column-span="4"
row-start="1"
row-span="4"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #c9f0f8;"></div
></q2-grid-area>
<q2-grid-area
column-start="1"
column-span="4"
row-start="5"
row-span="4"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #c9f0f8;"></div
></q2-grid-area>
<q2-grid-area
column-start="5"
column-span="4"
row-start="5"
row-span="4"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #c9f0f8;"></div
></q2-grid-area>
<q2-grid-area
column-start="9"
column-span="4"
row-start="5"
row-span="4"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #c9f0f8;"></div
></q2-grid-area>
<q2-grid-area
column-start="1"
column-span="4"
row-start="9"
row-span="4"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #c9f0f8;"></div
></q2-grid-area>
<q2-grid-area
column-start="5"
column-span="4"
row-start="9"
row-span="4"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #c9f0f8;"></div
></q2-grid-area>
<q2-grid-area
column-start="9"
column-span="4"
row-start="9"
row-span="4"
><div style="width: 100%; height: 100%; border: 1px solid black; background-color: #c9f0f8;"></div
></q2-grid-area>
</q2-grid>
</div>alignSets the vertical alignment behavior of the q2-grid-area component within its grid track at the baseline viewport size.
When set to auto, the grid area will inherit this property from the parent q2-grid component.
columnSpancolumn-spanSets the column span amount of the grid area at the baseline viewport size.
columnStartcolumn-startSets the starting column of the grid area at the baseline viewport size.
justifySets the horizontal alignment behavior of the q2-grid-area component within its grid track at the baseline viewport size.
When set to auto, the grid area will inherit this property from the parent q2-grid component.
lgAlignlg-alignSets the vertical alignment behavior of the q2-grid-area component within its grid track at the baseline viewport size.
When set to auto, the grid area will inherit this property from the parent q2-grid component.
lgColumnSpanlg-column-spanSets the column span amount of the grid area at the LG viewport size.
lgColumnStartlg-column-startSets the starting column of the grid area at the LG viewport size.
When set to auto, the grid area will automatically start at the first available column.
lgJustifylg-justifySets the horizontal alignment behavior of the q2-grid-area component within its grid track at the baseline viewport size.
When set to auto, the grid area will inherit this property from the parent q2-grid component.
lgRowSpanlg-row-spanSets the row span amount of the grid area at the LG viewport size.
lgRowStartlg-row-startSets the starting row of the grid area at the LG viewport size.
When set to auto, the grid area will automatically start at the first available row.
lgZIndexlg-z-indexSets the z-index of the grid area at the LG viewport size.
mdAlignmd-alignSets the vertical alignment behavior of the q2-grid-area component within its grid track at the baseline viewport size.
When set to auto, the grid area will inherit this property from the parent q2-grid component.
mdColumnSpanmd-column-spanSets the column span amount of the grid area at the MD viewport size.
mdColumnStartmd-column-startSets the starting column of the grid area at the MD viewport size.
When set to auto, the grid area will automatically start at the first available column.
mdJustifymd-justifySets the horizontal alignment behavior of the q2-grid-area component within its grid track at the baseline viewport size.
When set to auto, the grid area will inherit this property from the parent q2-grid component.
mdRowSpanmd-row-spanSets the row span amount of the grid area at the MD viewport size.
mdRowStartmd-row-startSets the starting row of the grid area at the MD viewport size.
When set to auto, the grid area will automatically start at the first available row.
mdZIndexmd-z-indexSets the z-index of the grid area at the MD viewport size.
rowSpanrow-spanSets the row span amount of the grid area at the baseline viewport size.
rowStartrow-startSets the starting row of the grid area at the baseline viewport size.
When set to auto, the grid area will automatically start at the first available row.
smAlignsm-alignSets the vertical alignment behavior of the q2-grid-area component within its grid track at the baseline viewport size.
When set to auto, the grid area will inherit this property from the parent q2-grid component.
smColumnSpansm-column-spanSets the column span amount of the grid area at the SM viewport size.
smColumnStartsm-column-startSets the starting column of the grid area at the SM viewport size.
When set to auto, the grid area will automatically start at the first available column.
smJustifysm-justifySets the horizontal alignment behavior of the q2-grid-area component within its grid track at the baseline viewport size.
When set to auto, the grid area will inherit this property from the parent q2-grid component.
smRowSpansm-row-spanSets the row span amount of the grid area at the SM viewport size.
smRowStartsm-row-startSets the starting row of the grid area at the SM viewport size.
When set to auto, the grid area will automatically start at the first available row.
smZIndexsm-z-indexSets the z-index of the grid area at the SM viewport size.
xlAlignxl-alignSets the vertical alignment behavior of the q2-grid-area component within its grid track at the baseline viewport size.
When set to auto, the grid area will inherit this property from the parent q2-grid component.
xlColumnSpanxl-column-spanSets the column span amount of the grid area at the XL viewport size.
xlColumnStartxl-column-startSets the starting column of the grid area at the XL viewport size.
When set to auto, the grid area will automatically start at the first available column.
xlJustifyxl-justifySets the horizontal alignment behavior of the q2-grid-area component within its grid track at the baseline viewport size.
When set to auto, the grid area will inherit this property from the parent q2-grid component.
xlRowSpanxl-row-spanSets the row span amount of the grid area at the XL viewport size.
xlRowStartxl-row-startSets the starting row of the grid area at the XL viewport size.
When set to auto, the grid area will automatically start at the first available row.
xlZIndexxl-z-indexSets the z-index of the grid area at the XL viewport size.
xsAlignxs-alignSets the vertical alignment behavior of the q2-grid-area component within its grid track at the baseline viewport size.
When set to auto, the grid area will inherit this property from the parent q2-grid component.
xsColumnSpanxs-column-spanSets the column span amount of the grid area at the XS viewport size.
xsColumnStartxs-column-startSets the starting column of the grid area at the XS viewport size.
When set to auto, the grid area will automatically start at the first available column.
xsJustifyxs-justifySets the horizontal alignment behavior of the q2-grid-area component within its grid track at the baseline viewport size.
When set to auto, the grid area will inherit this property from the parent q2-grid component.
xsRowSpanxs-row-spanSets the row span amount of the grid area at the XS viewport size.
xsRowStartxs-row-startSets the starting row of the grid area at the XS viewport size.
When set to auto, the grid area will automatically start at the first available row.
xsZIndexxs-z-indexSets the z-index of the grid area at the XS viewport size.
zIndexz-indexSets the z-index of the grid area at the baseline viewport size.
The following CSS variables are available to override the default theme styles of the q2-grid-areacomponent.