Layouts/Layout Grid

fd-col · 8 examples from SAP's documentation · Back to the gallery

About

The layout grid is made to separate data into both columns and rows. If there is not enough space on the current line of the same row, the item will go to the next line. To use the grid, the user must use all of the \

DifferentSizeColumns

To define the size of that column use the `fd-col--x` modifier, where `x` can go from 1-12

12 columns element
11 columns element
1 column element
10 columns element
2 columns element
9 columns element
3 columns element
8 columns element
4 columns element
7 columns element
5 columns element
6 columns element
6 columns element
5 columns element
7 columns element
4 columns element
8 columns element
3 columns element
9 columns element
2 columns element
10 columns element
1 column element
11 columns element
12 columns element

Responsiveness

You can define different column sizes for each inflection point. In this example for extra large the cells are taking 4 columns out of 12 `fd-col-xl--4`; 4 columns out of 12 in large `fd-col-lg--4`; 6 columns out of 12 in medium `fd-col-md--6`, and 12 out of 12 in small `fd-col--12`

(1 cell)
(2 cell)
(3 cell)
(4 cell)

Nesting

Add an extra `fd-row` class in between inner rows when using nesting. It will add a gutter in between rows.

2 col (~17%)
2 col inner row 1 (~14%)
6 coll inner row 2 (~34%)
4 coll inner row 3 (~10%)
8 coll inner row 3 (~23%)

Offset

To add an offset to the left of the column for all sizes use the `--offset-x` modifier. X will be the size of your choice. If the column after the offset col no longer fits in parent container it will switch to the next line. To add an offset to the left of the column for certain sizes and above use the `--offset-x--size` modifier, where size is either s,m,l,xl. To make the offset after and not before use the `--offset-after-x--size` modifier.

12 columns
6 columns
Different column-width and offset in different inflection points
6 columns with 6-column offset
2 column-width and offset after in different inflection points
4 columns with 2-column offset after
2 column element

NoHorizontalGap

To remove gutters between columns apply the `fd-container--no-horizontal-gap` modifier to the container.

8 col no gap
4 col no gap
6 col no gap
6 col no gap
4 col no gap
8 col no gap

NoVerticalGap

To remove gutters between rows apply the `fd-container--no-vertical-gap` modifier to the container.

8 col no gap
4 col no gap
6 col no gap
6 col no gap
4 col no gap
8 col no gap

NoGap

To remove gutters between rows and columns apply both the `fd-container--no-vertical-gap` and `fd-container--no-horizontal-gap` modifiers to the container.

8 col no gap
4 col no gap
6 col no gap
6 col no gap
4 col no gap
8 col no gap

AutoAdjusting

To make the column auto adjust and occupy the remaining space of the row use the `--full` modifier. There is a minimum width of 1/12 columns

Auto adjusting col before 7 col
7 col
Auto adjusting col after 7 col