No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:

  1. Missing Context/Providers: You can use decorators to supply specific contexts or providers, which are sometimes necessary for components to render correctly. For detailed instructions on using decorators, please visit the Decorators documentation.
  2. Misconfigured Webpack or Vite: Verify that Storybook picks up all necessary settings for loaders, plugins, and other relevant parameters. You can find step-by-step guides for configuring Webpack or Vite with Storybook.
  3. Missing Environment Variables: Your Storybook may require specific environment variables to function as intended. You can set up custom environment variables as outlined in the Environment Variables documentation.

This is a pre-release version and is not production ready. For new and ongoing projects, please refer to the latest Design System version.

Grid system

Use our powerful mobile-first flexbox grid to build layouts of all shapes and sizes thanks to a twelve column system, 5 default responsive tiers, Sass variables and mixins, and dozens of predefined classes.

Our grid system uses a series of containers, rows, and columns to layout and align content. It’s built with flexbox and is fully responsive. Below is an example and an in-depth explanation for how the grid system comes together.

Column
Column
Column
<div class="container"> <div class="row"> <div class="col">Column</div> <div class="col">Column</div> <div class="col">Column</div> </div> </div>

The above example creates three equal-width columns across all devices and viewports using our predefined grid classes. Those columns are centered in the page with the parent .container.

Don't do this!

Nor this!

Instead, your content should go here!

Breaking it down, here’s how the grid system comes together:

  • Our grid supports 5 responsive breakpoints. Breakpoints are based on min-width media queries, meaning they affect that breakpoint and all those above it. This means you can control container and column sizing and behavior by each breakpoint.
  • Container (e.g. .container) center and horizontally pad your content.
    Don't nest .containers, but use them (for example) as a wrapper for your content area:
    <body> <header>...</header> <main> <div class="container">...</div> </main> <footer>...</footer> </body>
  • Rows are wrappers for columns. Each column has horizontal padding (called a gutter) for controlling the space between them. This padding is then counteracted on the rows with negative margins to ensure the content in your columns is visually aligned down the left side. Rows also support modifier classes to uniformly apply column sizing and gutter classes to change the spacing of your content.
  • Columns are incredibly flexible. There are 12 template columns available per row, allowing you to create different combinations of elements that span any number of columns. Column classes indicate the number of template columns to span (e.g., .col-4 spans four). Widths are set in percentages so you always have the same relative sizing.
  • Gutters are also responsive and customizable. Gutter classes are available across all breakpoints, with all the same sizes as our margin and padding spacing. Change horizontal gutters with .gx-* classes, vertical gutters with .gy-*, or all gutters with .g-* classes. .g-0 is also available to remove gutters.
  • Sass variables, maps, and mixins power the grid. If you don’t want to use the predefined grid classes, you can use the grid’s source Sass to create your own with more semantic markup. We also include some CSS custom properties to consume these Sass variables for even greater flexibility for you.

Utilize breakpoint-specific column classes for easy column sizing without an explicit numbered class like .col-sm-6.

For example, here are two grid layouts that apply to every device and viewport, from the smallest to the biggest. Add any number of unit-less classes for each breakpoint you need and every column will be the same width.

1 of 2
2 of 2
1 of 3
2 of 3
3 of 3

Auto-layout for flexbox grid columns also means you can set the width of one column and have the sibling columns automatically resize around it. You may use predefined grid classes (as shown below), grid mixins, or inline widths. Note that the other columns will resize no matter the width of the center column.

1 of 3
2 of 3 (wider)
3 of 3
1 of 3
2 of 3 (wider)
3 of 3

Use .col-{breakpoint}-auto classes to size columns based on the natural width of their content.

1 of 3
Variable width content
3 of 3
1 of 3
Variable width content
3 of 3

Our grid includes 5 tiers of predefined classes for building complex responsive layouts.

For grids that are the same from the smallest of devices to the largest, use the .col and .col-* classes. Specify a numbered class when you need a particularly sized column.

col
col
col
col
col-8
col-4

Using a single set of .col-sm-* classes, you can create a basic grid system that starts out stacked and becomes horizontal at a smaller breakpoint.

col-md-8
col-md-4
col-md
col-md
col-md

Don’t want your columns to simply stack in some grid tiers? Use a combination of different classes for each tier as needed.

.col-md-8
.col-6 .col-md-4
.col-6 .col-md-4
.col-6 .col-md-4
.col-6 .col-md-4
.col-4
.col-8

Use the responsive .row-cols-* classes to quickly set the number of columns that best render your content and layout. Whereas normal .col-* classes apply to the individual columns (e.g., .col-md-4), the row columns classes are set on the parent .row as a shortcut. With .row-cols-auto you can give the columns their natural width.

Use these row columns classes to quickly create basic grid layouts or to control your card layouts.

Column
Column
Column
Column

Column
Column
Column
Column

Column
Column
Column
Column

Column
Column
Column
Column

Column
Column
Column
Column

To control the space between your columns, add either .g-* (horizontal and vertical) .gx-* (horizontal) or .gy-* (vertical) classes on the element containing the .row class.

Column
Column
Column
Column

To nest your content with the default grid, add a new .row and set of .col-* columns within an existing .col-* column. Nested rows should include a set of columns that add up to 12 or fewer.

Note: the style in this example is applied to the column to visually better understand nesting. However, it's recommended to apply the style on a child element of the column.

Level 1: .col-md-3
Level 2: .col-8 .col-md-6
Level 2: .col-4 .col-md-6