layout-grid
Auto-fit responsive grid layout. Creates equal-width columns that automatically reflow based on available space.
Attributes
| Attribute | Values | Default | Description |
|---|---|---|---|
data-layout-min |
10rem, 12rem, 15rem, 18rem, 20rem, 25rem |
15rem |
Minimum column width before wrapping |
data-layout-gap |
none, xs, s, m, l, xl |
m |
Gap between grid items |
Minimum Width Variants
The data-layout-min attribute sets the minimum width each column can shrink to before the grid reflows.
data-layout-min="10rem" (narrow)
Card 1
Card 2
Card 3
Card 4
Card 5
Card 6
data-layout-min="15rem" (default)
Card 1
Card 2
Card 3
Card 4
Card 5
Card 6
data-layout-min="20rem" (wide)
Card 1
Card 2
Card 3
Card 4
Code
Gap Variants
The data-layout-gap attribute controls spacing between grid items.
data-layout-gap="xs"
1
2
3
4
data-layout-gap="l"
1
2
3
4
Usage Examples
Product Grid
Product Name
$29.99
Product Name
$34.99
Product Name
$24.99
Feature Cards
Optimized for speed with minimal overhead.
Built with WCAG guidelines in mind.
Works without JavaScript, enhances with it.
Stats Grid
CSS Implementation
Related Elements
- layout-stack - Vertical stacking layout
- layout-cluster - Horizontal grouping with wrapping
- layout-sidebar - Two-column layout with sidebar
- layout-card - Card container