Grid Item
Places one child on explicit grid lines with fixed spans and self-alignment.
GridItem places a child on explicit grid lines, gives it fixed row or column spans, and controls its self-alignment. It must be used inside a CSS Grid container.
Main content · columns 1–3
Sidebar · three rows
Activity
Timeline
Reports
Import
Section titled “Import”import { Grid, GridItem } from "@zentara-co/zenos-ui";Placement
Section titled “Placement”column and row select starting grid lines from 1 through 13 or auto. columnSpan and rowSpan cover 1 through 12 tracks, full, or auto.
<Grid columns={4} rows={3}> <GridItem column={1} row={1} columnSpan={3}> Main content </GridItem> <GridItem column={4} row={1} rowSpan={3}> Sidebar </GridItem></Grid>These placement props are intentionally fixed. Use GridSpan when only the span must change across breakpoints, or application-specific classes when explicit starting lines must respond.
Self-alignment
Section titled “Self-alignment”alignSelf moves one item on the block axis and justifySelf moves it on the inline axis.
Stretch across the assigned area
Polymorphism
Section titled “Polymorphism”GridItem renders a div by default. Use as="li", as="article", or another semantic element while retaining placement styles, native props, and the correct ref type.
API
| Prop | Type | Default | Description |
|---|---|---|---|
as | ElementType | div | Rendered semantic element. |
column / row | 1–13 | auto | — | Starting grid line. |
columnSpan / rowSpan | 1–12 | full | auto | — | Track span. |
alignSelf | AlignSelf | — | Item alignment on the block axis. |
justifySelf | JustifySelf | — | Item alignment on the inline axis. |
native props | React.HTMLAttributes<HTMLElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”CSS placement does not change DOM order. Keep visual order consistent with reading and focus order, especially when manually assigning rows and columns. Do not use grid placement to move a later interactive control ahead of an earlier one visually.