import './Grid.css'

## Examples

### Smart (responsive)


import Example1 from './Example1.html?raw'

<LiveExample html={Example1} />

### Smart with overrides (responsive)


import Example2 from './Example2.html?raw'

<LiveExample html={Example2} />

### Base


import Example3 from './Example3.html?raw'

<LiveExample html={Example3} />

### Gutter


import Example4 from './Example4.html?raw'

<LiveExample html={Example4} />

### Responsive


import Example5 from './Example5.html?raw'

<LiveExample html={Example5} />

### Nested


import Example6 from './Example6.html?raw'

<LiveExample html={Example6} />

### Offsets


import Example7 from './Example7.html?raw'

<LiveExample html={Example7} />

### Row spans


import Example8 from './Example8.html?raw'

<LiveExample html={Example8} />

### As a list


import Example9 from './Example9.html?raw'

<LiveExample html={Example9} />

## Ordering

Ordering - Ordering can be applied to nested <code>.pf-v6-l-grid</code> and <code>.pf-v6-l-grid\_\_item</code>s. Spacing may need to be managed based on how items are ordered. Because order could apply to an innumerable number of elements, order is set inline as `--pf-v6-l-grid--item--Order{-on-[breakpoint]}: {order}`.

### Ordering example


import Example10 from './Example10.html?raw'

<LiveExample html={Example10} />

### Responsive ordering


import Example11 from './Example11.html?raw'

<LiveExample html={Example11} />

### Grouped ordering


import Example12 from './Example12.html?raw'

<LiveExample html={Example12} />

### Grouped, responsive ordering


import Example13 from './Example13.html?raw'

<LiveExample html={Example13} />

## Documentation

### Overview

The grid layout is based on CSS Grid’s two-dimensional system of columns and rows. This layout styles the parent element and its children to achieve responsive column and row spans as well as gutters.

### Usage

| Class | Applied to | Outcome |
| -- | -- | -- |
| `.pf-v6-l-grid` | `<div>` | Initializes the grid layout. |
| `.pf-v6-l-grid__item` | `<div>` | Explicitly sets a child of the grid. This class isn't necessary, but it is included to keep inline with BEM convention, and to provide an entity that will later be used for applying modifiers. |
| `.pf-m-gutter` | `.pf-v6-l-grid` | Adds space between children by using the globally defined gutter value. |
| `.pf-m-all-{1-12}-col{-on-[breakpoint]}` | `.pf-v6-l-grid` | Defines grid item size on grid container at optional [breakpoint](/tokens/all-patternfly-tokens). |
| `.pf-m-{1-12}-col{-on-[breakpoint]}` | `.pf-v6-l-grid__item` | Defines grid item size at optional [breakpoint](/tokens/all-patternfly-tokens).  Although not required, they are strongly suggested. If not used, grid item will default to 12 col. |
| `.pf-m-{2-x}-row{-on-[breakpoint]}` | `.pf-v6-l-grid__item` | Defines grid item row span at optional [breakpoint](/tokens/all-patternfly-tokens).  For row spans to function correctly, the value of of the current row plus the grid items to span must be equal to or less than 12. Example: `.pf-m-8-col.pf-m-2-row` + `.pf-m-4-col` + `.pf-m-4-col`. There is no limit to number of spanned rows. |
| `--pf-v6-l-grid--item--Order{-on-[breakpoint]}: {order}` | `.pf-v6-l-grid > .pf-v6-l-grid`, `.pf-v6-l-grid__item` | Modifies the order of the grid layout element at optional [breakpoint](/tokens/all-patternfly-tokens). |