Examples
Basic
Mixed spans — two 6-cols across the top, three 4-cols below. No gutter.
Spans
Visual reference for 1-col through 12-col widths. Spans add up to the 12-col grid.
Responsive spans
Per-breakpoint spans: 12 on mobile, 6 on md, 4 on lg. Resize the window to see it reflow.
Smart
pf-m-all-6-col-on-sm / pf-m-all-4-col-on-md size every item per breakpoint.
Smart with overrides
All-items sizing with per-item col overrides at breakpoints.
Nested
A grid nested inside a grid item, with its own spans.
Offsets
pf-m-offset-*-col pushes items right by whole columns.
Row spans
pf-m-*-row spans an item across grid rows.
As a list
The grid rendered as ul/li — layout without giving up list semantics.
- item 1
- item 2
- item 3
- item 4
Grouped ordering
Ordering applied to grouped grid sections.
Grouped responsive ordering
Grouped ordering that changes at breakpoints.
Documentation
Grid props
Parameters accepted by {#include layouts/primitives/grid ... /}.
| Name | Type | Description |
|---|---|---|
* id | String | DOM id on the container. |
gutter | boolean | Adds pf-m-gutter for column + row gaps. |
allCols | Integer 1-12 | Shortcut — emits pf-m-all-{allCols}-col so every direct child has the same span without needing per-item classes. |
slot items | Qute block | Grid children. Each item should be a pf-v6-l-grid__item with its own pf-m-N-col / pf-m-N-col-on-{bp} / pf-m-offset-N-col-on-{bp}. |
Usage
Grid vs. Gallery vs. Flex. Use Grid for explicit 12-column layouts with variable widths. Use Gallery when every item should be equal width and auto-fill. Use Flex for one-dimensional rows/columns.
Breakpoints. PF v6 has six breakpoints: default, sm, md, lg, xl, 2xl. Append -on-{bp} to any span class.