structyl

Grid

stable

A responsive CSS grid wrapper.

Basic usage

A
B

Examples

Equal columns

Use the columns prop for simple equal-width grids.

Open
Review
Done

Dashboard composition

Combine Grid with column spans through className for dashboard cards.

Activity
72%
Queue
Health

Responsive spans

Use columns, spacing and breakpoint span props for MUI-style grid layouts.

sm=6
sm=6

Features

  • Column presets.
  • Gap presets.

Installation

bash
pnpm dlx structyl add grid

API Reference

Grid

Grid container and item helper.

PropTypeDefault
containerboolean

Apply grid container styles.

true
itemboolean

Marks usage as a grid item for API parity.

columns1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12

Number of grid columns.

12
spacing0 | 1 | 2 | 3 | 4 | 5 | 6 | 8

Gap for both axes.

rowSpacing0 | 1 | 2 | 3 | 4 | 5 | 6 | 8

Vertical gap override.

columnSpacing0 | 1 | 2 | 3 | 4 | 5 | 6 | 8

Horizontal gap override.

size | xs | sm | md | lg | xl'auto' | 'grow' | 1…12

Column span at each breakpoint.

classNamestring

Additional Tailwind classes merged with the component defaults.

Grid | structyl