# Grid

An adaptive content grid with optional fixed columns.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"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

| Prop | Values | Default |
| --- | --- | --- |
| `columns` | `1 \| 2 \| 3 \| 4 \| 6 \| 12` | `—` |
| `minItemWidth` | `string` | `—` |
| `gap` | `"0" \| "1" \| "2" \| "3" \| "4" \| "6" \| "8" \| "12"` | `"4"` |
| `Native HTML props` | `HTMLAttributes<HTMLDivElement>` | `Forwarded` |
