Pattern Library Grid System
The Pattern Library uses the Bootstrap 4 grid system.
The grid system is composed of elements with
col-* classes. All column elements should be placed inside the
row element. For the columns to take up 100% of the row width, the column classes should add up to 12.
For more information see Bootstrap’s documentation on their grid system.
Three equal columns
Get three equal-width columns starting at desktops and scaling to large desktops. On mobile devices, tablets and below, the columns will automatically stack.
Three unequal columns
Get three columns starting at desktops and scaling to large desktops of various widths. Remember, grid columns should add up to twelve for a single horizontal block. More than that, and columns start stacking no matter the viewport.
Get two columns starting at desktops and scaling to large desktops.
Full width, single column
No grid classes are necessary for full-width elements.
Two columns with two nested columns
Per the documentation, nesting is easy—just put a row of columns within an existing column. This gives you two columns starting at desktops and scaling to large desktops, with another two (equal widths) within the larger column.
At mobile device sizes, tablets and down, these columns and their nested columns will stack.
Mixed: mobile and desktop
The Bootstrap v4 grid system has five tiers of column classes: all breakpoints (beginning at extra small breakpoints), sm (small), md (medium), lg (large), and xl (extra large). You can use nearly any combination of these classes to create more dynamic and flexible layouts.
Each tier of classes scales up, meaning if you plan on setting the same widths for md, lg, and xl breakpoints, you only need to specify the md column class.
Mixed: mobile, tablet, and desktop
Offset, push, and pull resets
Reset offsets, pushes, and pulls at specific breakpoints.