Layout

Container

The Container component adds an outer padding and centers itself horizontally in the viewport. We have two sizes of the container, wide (12 columns) and narrow (10 columns).

content






Grid

We use a 12-column grid with 8/24/24/24px gutter width. The maximum colum width is 94px. Always place columns directly inside rows. Each column has a span and offset. The defaults are 12 and 0, respectively.

span-6
span-6
span-2
offset-1 span-3
offset-3 span-3
offset-2 span-4






The span and offset can differ at each breakpoint range:




TwoColumn

When using a two column layout, the gutter between the two columns must be slightly larger than the standard grid gutter. In these cases use the TwoColumn, TwoColumnL, and TwoColumnR components instead of Row and Column.

TwoColumnL
TwoColumnR




Breakpoints

We use three breakpoints (480, 800, 1100), which gives us four breakpoint ranges:

  • xs: 0 – 479px
  • s: 480px – 799px
  • m: 800px – 1099px
  • l: 1100px +

In the source code, when we have something that changes across the breakpoint ranges, we use the Responsive<T> type:







The materials/responsive module also provides other convenient functions to deal with responsiveness.

mqFeatures and mq

Use whichever is more convenient when defining CSS that is dependent on the breakpoint range.











Spacing

The following pixes sizes are available as constants: spNNN, where NNN is the zero-padded pixel number: 5, 10, 15, 20, 25, 40, 60, 80.









Space

Use the Space component to add space around elements. Use any CSS property as the prop name. The value of the prop should be of type Responsive<T>.


You can actually use the Space component to set any CSS property, not just spacing-related ones (for example <Space color={{ xs: "green", s: "blue", … }}>). But please don't.