Basic Grid
Create a smart grid with the.grid class:
auto-fit with a minimum column width of 9rem, automatically creating as many columns as will fit.
Grid Column Minimum Width
Control the minimum width of grid columns using.is-col-min-{n} classes:
Available Column Minimum Sizes
Use.is-col-min-1 through .is-col-min-32. The value is calculated as n × 1.5rem:
.is-col-min-1: 1.5rem.is-col-min-2: 3rem.is-col-min-4: 6rem.is-col-min-6: 9rem (default).is-col-min-8: 12rem.is-col-min-12: 18rem.is-col-min-16: 24rem.is-col-min-24: 36rem.is-col-min-32: 48rem
Fixed Grid
For precise control, use.fixed-grid with explicit column counts:
Available Column Counts
Use.has-1-cols through .has-12-cols for any column count from 1 to 12.
Responsive Fixed Grid
Change column counts at different breakpoints:-mobile: up to 768px-tablet: 769px and up-desktop: 1024px and up-widescreen: 1216px and up-fullhd: 1408px and up
Auto Count Grid
Use.has-auto-count for automatic responsive column counts:
- Mobile: 2 columns
- Tablet: 4 columns
- Desktop: 8 columns
- Widescreen: 12 columns
- Full HD: 16 columns
Auto-Fill vs Auto-Fit
By default, grids useauto-fit. Use .is-auto-fill for different wrapping behavior:
Cell Spanning
Column Spanning
Make cells span multiple columns:.is-col-span-1 through .is-col-span-12.
Row Spanning
Make cells span multiple rows:.is-row-span-1 through .is-row-span-12.
Combined Spanning
Cell Positioning
Column Start Position
Place cells at specific column positions:.is-col-start-1 through .is-col-start-12.
Column End Position
Specify where cells should end:.is-col-end-1 through .is-col-end-12.
Starting from End
Position cells from the end of the grid:.is-col-from-end-1 through .is-col-from-end-12.
Row Positioning
The same positioning classes work for rows:.is-row-start-{n}: Start at row n.is-row-end-{n}: End at row n.is-row-from-end-{n}: Start from end
End Position Shorthand
Use.is-col-start-end or .is-row-start-end to start from the last grid line:
Responsive Cell Properties
All cell classes support responsive breakpoints:-mobile-tablet-tablet-only-touch-desktop-desktop-only-widescreen-widescreen-only-fullhd
Grid Gap
The default gap is0.75rem. You can customize it using CSS variables:
Practical Examples
Responsive Image Gallery
Dashboard Layout
Card Grid with Featured Item
Auto-Responsive Grid
CSS Variables
Customize the grid using CSS variables:Best Practices
When to use grid vs. columns
When to use grid vs. columns
Use grid when you need:
- Automatic responsive layouts without manual breakpoints
- Modern CSS Grid features
- Equal-width items that wrap naturally
- Complex 2D layouts with row and column spanning
- Precise control over individual column widths
- Flexbox-based flexibility
- Support for older browsers
- Simple multi-column layouts
Performance tips
Performance tips
- Use
auto-fit(default) for most cases; it performs better - Prefer
.fixed-gridwith explicit column counts for predictable layouts - Use
.has-auto-countfor quick responsive grids without custom breakpoints - Avoid excessive cell spanning in large grids
Accessibility considerations
Accessibility considerations
- Grid order is based on source order by default
- Use semantic HTML elements inside cells (article, section, etc.)
- Ensure keyboard navigation works naturally
- Test screen reader behavior with positioned cells
Browser support
Browser support
The smart grid system uses CSS Grid, which is supported in all modern browsers:
- Chrome 57+
- Firefox 52+
- Safari 10.1+
- Edge 16+
