Grid System
A comprehensive 12-column flexbox grid with Fibonacci/Golden Ratio proportional layouts, responsive containers, order utilities, and an interactive toggle between standard and Fibonacci modes.
12-column basics
Put a .vd-row inside a container and give each child a .vd-col-{1-12} span. Spans in a row add up to 12; anything beyond wraps to the next line. Columns carry the --vd-grid-gutter (13px) as padding, so style an inner element rather than the column itself.
.vd-col-12.vd-col-6.vd-col-6.vd-col-4.vd-col-4.vd-col-4.vd-col-3.vd-col-3.vd-col-3.vd-col-3.vd-col-8.vd-col-4.vd-col-2.vd-col-8.vd-col-2.vd-col-auto.vd-col-6Standard vs Fibonacci — when to choose
Both share the same 12-column flexbox engine — reach for whichever fits the content. You can flip the live toggle in the demos below to feel the difference.
Standard 12-column
- Forms, dashboards, and data tables
- Equal or simple fractions (halves, thirds, quarters)
- Familiar, predictable responsive control
Golden / Fibonacci
- Editorial, hero, and marketing layouts
- Content + sidebar at a natural ≈1.618:1 split
- Galleries and asymmetric, organic emphasis
New to the proportion system? See Golden Ratio and Fibonacci vs Standard.
2XL Breakpoint (1400px)
The grid supports 6 breakpoints: base, sm (576px), md (768px), lg (992px), xl (1200px), and 2xl (1400px). These twelve columns go 1 → 2 → 3 → 4 → 6 → 12 per row as the viewport widens — resize the window to watch them reflow.
Current breakpoint: base
Responsive Containers
Responsive containers are fluid below their breakpoint and fixed-width above. They scale up at each subsequent breakpoint.
.vd-container-sm — max 521px from 576px, then grows with each breakpoint.vd-container-md — max 610px from 768px, then grows.vd-container-lg — max 987px from 992px, then grows.vd-container-xl — max 1364px from 1200px, then grows.vd-container-2xl — max 1597px from 1400pxOrder Utilities
Reorder columns visually without changing HTML source order. Responsive variants available at all breakpoints.
.vd-order-3.vd-order-1.vd-order-2.vd-order-last.vd-order-firstFibonacci 4-Column (1:2:3:5)
Ratio 1:2:3:5 (total 11 parts). Use .vd-row-fib-4 with .vd-col-fib-1, .vd-col-fib-2, .vd-col-fib-3, .vd-col-fib-5.
Fibonacci 3-Column (3:5:8)
Ratio 3:5:8 (total 16 parts). Use .vd-row-fib-3-alt with .vd-col-fib-3, .vd-col-fib-5, .vd-col-fib-8.
CSS Grid: 4-Column Fibonacci
CSS Grid: 3:5:8 Fibonacci
Fibonacci Gap Utilities
Gap utilities using Fibonacci values. Works with CSS Grid and flex containers using the gap property.
.vd-gap-fib-3 (3px) .vd-gap-fib-8 (8px) .vd-gap-fib-21 (21px) Live Grid Toggle (useGrid)
useGrid(containerRef) manages one element: it flips the .vd-grid-standard / .vd-grid-fibonacci class, keeps data-layout-mode plus the region aria-label in sync, and dispatches a grid:modechange event. The real VD3 UI grid CSS then lays out each child .vd-row by its column count — golden ratio (2 cols), 2:3:5 (3 cols), or 1:2:3:5 (4 cols).
3-column row:
2-column row → golden ratio (1 : 1.618):
4-column row → 1 : 2 : 3 : 5:
Document-Level Default (setGridSystem)
Call setGridSystem once at app bootstrap to make Fibonacci the default everywhere, mirroring how the theme layer stamps data-theme. It sets data-grid="fibonacci" on <html>, so every .vd-row — including your app shell — reflows into Fibonacci proportions. Wrap any subtree that must stay 12-column in a .vd-grid-standard container; the closest explicit container wins. For a single section, prefer the scoped useGrid toggle above.
Offset Utilities
Complete offset utilities from 0-11 at all breakpoints. Use .vd-offset-0 to reset an offset at a specific breakpoint.