Grid
A responsive CSS Grid container with typed tracks, gaps, alignment, and auto-flow.
Grid creates responsive two-dimensional layouts with typed track counts and spacing. It controls the grid container; use GridItem or GridSpan when a child needs explicit placement or spanning.
Assets
128
Findings
7
Coverage
94
Members
24
Import
Section titled “Import”import { Grid } from "@zentara-co/zenos-ui";Tracks and gaps
Section titled “Tracks and gaps”columns and rows accept responsive counts from 1 through 12. gap sets both axes, while columnGap and rowGap refine each axis independently.
Track 1
Track 2
Track 3
Track 4
Track 5
Track 6
Auto flow
Section titled “Auto flow”autoFlow controls how auto-positioned children fill explicit tracks. It is a direct value rather than a responsive prop.
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Use dense, row-dense, or column-dense carefully: dense packing may make visual order differ from source order.
Alignment
Section titled “Alignment”align controls how items sit on the block axis of their cells. justify distributes the grid content on the inline axis. Both accept responsive values. Use GridItem’s self-alignment props when only one child differs.
Semantics
Section titled “Semantics”Grid renders a div by default. Use as="ul" with list-item children for a semantic collection, or another element that matches the content. Grid styles do not remove native list or landmark semantics.
API
| Prop | Type | Default | Description |
|---|---|---|---|
as | ElementType | div | Rendered semantic element. |
columns / rows | Responsive<1 | 2 | ... | 12> | columns: 1 | Responsive explicit grid track counts. |
gap | Responsive<Spacing> | 4 | Shared row and column gap. |
columnGap / rowGap | Responsive<Spacing> | — | Axis-specific gap overrides. |
align / justify | Responsive<Align | Justify> | — | Grid item alignment and content distribution. |
autoFlow | row | column | dense | row-dense | column-dense | — | Placement direction for auto-positioned items. |
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”Keep DOM order aligned with the intended reading and keyboard order. Explicit placement and dense flow can rearrange visuals without rearranging the accessibility tree. Test responsive layouts at narrow widths, 200% zoom, and with keyboard focus visible.