Skip to main content
Version: latest
Server Component

Grid is best rendered on the server. Use the standard import (e.g. @prokodo/ui/grid) — the library detects the runtime automatically.

Grid

Grid renders a responsive CSS grid container. Column count and gap are configurable per breakpoint, making it easy to build multi-column page sections.

Live demo →

Overview

import { Grid } from "@prokodo/ui/grid"
;<Grid cols={3} gap="lg">
<Card>Item 1</Card>
<Card>Item 2</Card>
<Card>Item 3</Card>
</Grid>

Import

import { Grid } from "@prokodo/ui/grid"

CSS:

import "@prokodo/ui/grid.css"

Props

PropTypeDefaultRequiredDescription
childrenReactNodeGrid cell contents.
columnsGridColumns2Number of grid columns.
gap"none" | "xs" | "sm" | "md" | "lg" | "xl""md"Gap between cells.
rowHeightstring | numberFixed row height.
classNamestringCSS class on root element.

See src/components/grid/Grid.model.ts for the full GridProps type.


Design Tokens

Customise via CSS custom properties on :root or a scoped ancestor element.

TokenDefaultDescription
--pk-grid-paddingvar(--pk-space-lg)Inner padding of the grid container

WCAG 2.2 Status

CriterionNameStatusNote
1.3.1Info and Relationships (A)✅ FulfilledSemantic structure (headings, lists, labels, landmarks) must be conveyed programmatically via HTML or ARIA.
1.3.2Meaningful Sequence (A)🔍 Manual reviewContent reading order in the DOM must match the intended visual presentation order.
1.4.4Resize Text (AA)🔍 Manual reviewText must remain readable and functional when scaled to 200% without assistive technology.

Test coverage: 2 jest-axe assertion(s) across 1 test file(s) · 0 ARIA attribute occurrence(s) in source scan. Criteria marked 🔍 require manual verification in the final product integration and theme context.

Storybook

👉 Open Grid in Storybook


Source

src/components/grid/Grid.model.ts