Skip to main content
Version: Next

Grid

A lightweight semantic grid layout component built with native HTML and CSS variables.

The Grid component in ignix-lite uses the [data-grid] attribute on any semantic container element - <section>, <ul>, <article>, etc. - and supports responsive column counts, gap sizes, alignment, dense packing, and column/row span helpers.


Two Column

Column 1
Column 2

Three Column

Column 1
Column 2
Column 3

Four Column

Column 1
Column 2
Column 3
Column 4

Five Column

Col 1
Col 2
Col 3
Col 4
Col 5

Six Column

Col 1
Col 2
Col 3
Col 4
Col 5
Col 6

Auto Fit

Columns size and wrap automatically - no breakpoints needed.

Item 1
Item 2
Item 3
Item 4
Item 5

Auto Fill

Like auto-fit but preserves empty column slots rather than collapsing them.

Item 1
Item 2
Item 3

Gap

sm
sm
sm
lg
lg
lg
xl
xl
xl

Align Center

Tall
Short
Medium

Align End

Tall
Short
Medium

Column Span

Span 2
Col
Col
Col
Col
Col

Full Width Span

Col 1
Col 2
Col 3
Full Width

Row Span

Row Span 2
B
C
D
E

Dense Packing

Items back-fill empty slots automatically.

Wide
A
B
C
Wider
D

Mixed Spans

Span 3
Span 2
1
Full

Attributes

AttributeTypeDescription
data-grid'1' | '2' | '3' | '4' | '5' | '6' | 'auto' | 'fill'Sets the column layout on the grid container
data-gap'xs' | 'sm' | 'md' | 'lg' | 'xl'Controls the gap between grid items
data-align'start' | 'center' | 'end' | 'stretch' | 'baseline'Aligns items on the cross axis
data-justify'start' | 'center' | 'end' | 'stretch'Justifies items on the inline axis
data-densebooleanEnables dense packing to back-fill empty slots
data-col'1' | '2' | '3' | '4' | '5' | '6' | 'full'Sets column span on a child item
data-row'2' | '3'Sets row span on a child item