Spacing

Spacing refers to the negative area between elements, providing measurement for organizing layouts. While Salt provides a general approach to spacing, it isn’t an exhaustive set of guidelines. Consistent spacing enhances visual appeal and functionality in layouts. Space relates to size and visual consistency through alignment of baselines, gutters, margins etc.

Spatial tokens help align layouts and create consistent visual rhythm.

The Salt spacing system is structured around a base unit of --salt-spacing-100 for each density, with a scale that is proportional across all densities. Every space token within the system is a multiple of --salt-spacing-100 and percentages of the base unit. This scale offers flexibility that uses geometric progressions.

TokenFormulaHigh Density (HD) (px)Medium Density (MD) (px)Low Density (LD) (px)Touch Density (TD) (px)
--salt-spacing-250.25x1234
--salt-spacing-500.50x2468
--salt-spacing-750.75x36912
--salt-spacing-1001.00x481216
--salt-spacing-1501.50x6121824
--salt-spacing-2002.00x8162432
--salt-spacing-2502.50x10203040
--salt-spacing-3003.00x12243648
--salt-spacing-3503.50x14284256
--salt-spacing-4004.00x16324864
--salt-spacing-4504.50x18365472
--salt-spacing-5005.00x20406080
--salt-spacing-5505.50x22446688
--salt-spacing-6006.00x24487296
--salt-spacing-6506.50x265278104
--salt-spacing-7007.00x285684112
--salt-spacing-7507.50x306090120
--salt-spacing-8008.00x326496128
--salt-spacing-8508.50x3468102136
--salt-spacing-9009.00x3672108144
--salt-spacing-9509.50x3876114152

Spacing is a powerful tool to emphasize certain elements while de-emphasizing others, guiding the user's journey through the content. It's important to use varied spacing between elements to establish a visual hierarchy. The vertical separation of items such as headings, blocks of text, form elements and cards should follow a consistent pattern to create visual rhythm.

Horizontal dividers are used to divide regions of a layout and should be spaced consistently with salt-spacing-300 above and below sections. For more information on dividers, please refer to the divider component page.

Side by side example of hierarchical spacing with and without a divider.

Headings serve as the primary title for different content types by providing visual separation and hierarchy. All headings should be accompanied by standard spacing above and below. The spacing placed directly below a heading depends on the level of focus placed on the item.

To find out more about how to use spacing in headers, please refer to the forms pattern page.

HeadingSpace aboveSpace below
H1--salt-spacing-200--salt-spacing-300
H2--salt-spacing-200--salt-spacing-200
H3--salt-spacing-200--salt-spacing-100
H4--salt-spacing-200None

A container represents an enclosed area with information, this is typically anything that is in a div in code. Spacing in containers varies depending on the container size.

Please refer to the header block pattern page to learn more about container spacing in context.

Container sizePadding size
Large--salt-spacing-300
Medium--salt-spacing-200
Small--salt-spacing-100

Standard spacing between items in a horizontal configuration is typically --salt-spacing-300. This aligns with the design system's responsive layout grid and will automatically adjust depending on the density you're using.

Horizontal spacingSpace between
Buttons--salt-spacing-100
Components--salt-spacing-300
Diagram of what spacing between buttons should look like.
Diagram of what spacing between components should look like.

We appreciate your thoughts and feedback on any content in the Salt foundations. Please contact us if you have any comments or questions.