Skip to content
v0.2.10

Grid

An adaptive content grid with optional fixed columns.

Preview
First
Second
Third

Use Grid

Grid is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
grid.tsxTSX
"use client";

import { FloodRoot, Grid, Surface } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Grid minItemWidth="16rem" gap="4"><Surface>First</Surface><Surface>Second</Surface></Grid>
    </FloodRoot>
  );
}

Design notes

  • Default auto-fit columns clamp their minimum to available width, so narrow parents retain a single column.
  • Explicit columns retain their count; choose this deliberately. minItemWidth applies only to automatic columns and accepts a CSS length.
  • Cells remain ordinary content, not an ARIA grid. Use native tables for tabular relationships and host media/container queries for deliberate breakpoints.
  • Available in 0.2.4; use matching installed declarations.

API reference

PropValuesDefault
columns1 | 2 | 3 | 4 | 6 | 12—
minItemWidthstring—
gap"0" | "1" | "2" | "3" | "4" | "6" | "8" | "12""4"
Native HTML propsHTMLAttributes<HTMLDivElement>Forwarded
View TypeScript source