Grid System UsageOverview

A grid system conveys balance and structure to your application, which reduces cognitive load to your users. By properly organizing your content into a preset measurement, information becomes clearer and the experience improves overall.

Subdivisions

The design system supports a percentage-based, flexbox grid to ensure precision while accommodating for both fixed and fluid containers. The current levels are:

Two consecutive columns are separated by a gutter of one unit of spacing (1rem/16px).

Spacing

Our grid system supports offsetting columns to accommodate different spacing requirements. This becomes especially useful if there's a need to highlight a section of content that fits better into a smaller space, while still accommodating to the grid's measurements.

Containment

The design system's grid implementation supports a 75rem maximum width global container where your application can live. Since the grid system is based on flexbox — as opposed to fixed width columns —, it is responsive and adaptive by design.

If your application requires a different layout where a grid lives inside a nested location, you may choose to do that, as the container we recommend only exercises that role.

Responsiveness

Currently there are three major viewports the design system targets:

Our grid system allows for defining different widths for each of these different viewports.

In the example below, enable a different viewport by selecting the 4th icon from the toolbar.

Best Practices

On smaller viewports:

Code

Typically, an implementation of a grid includes:

Here is a full example of a group of columns aligned in a grid.

<div class="ul-grid__container">
        <div class="ul-grid__row -wrap">
          <div class="ul-grid__column -x10 -offset-10-desktop -x100-mobile">
            <div class="column-fill">Column</div>
          </div>
      
          <div class="ul-grid__column -x60 -x100-mobile">
            <div class="column-fill">Column</div>
          </div>
      
          <div class="ul-grid__column -x20 -x100-mobile">
            <div class="column-fill">Column</div>
          </div>
        </div>
      </div>