Spacing is an important — and often overlooked — part of product design. Zeta provides tokens and other principles to take the guesswork out of spacing and help deliver clear, functional layouts.
Empty space — also known as white space — is important in design. It can be used to break up sections on a page or to help create focus on certain element(s). White space helps with information processing; too much dense information can be disorienting or overwhelming for a user. Sections of a UI are allowed to be dense, but the whole page should not be crowded; there should be white space to let the user’s eye rest.
The Zeta spacing scale complements the 4px mini unit scale by using multiples of 4. It includes both small increments needed to create appropriate spatial relationships for detail-level designs as well as larger increments used to control the density of a design. Each level of the spacing scale has its own token. Spacing tokens can be used inside of components for building and between components for layout spacing.
Applying space
Spacing can be applied to margin or padding properties, as well as to both vertical and horizontal edges following a more traditional CSS box model.
example:
Content
Border
Padding 3,1,3,4 REM
Margin 3REM (Transparent)
Padding/Margin
Token
px
REM
margin
$spacing.zeta.square.x12
48
3
padding
$spacing.zeta.squish.x12
48
3
padding right
$spacing.zeta.x4
$spacing.zeta.b
16
1
padding left
$spacing.zeta.x16
$spacing.zeta.xl
64
4
Space spatial concepts
Spatial concept we use: insetting content from an edge, varying an inset’s shape, spacing items inline, and stacking items within and between a component.
These concepts — inset, inset squish, stack, inline, and grid — cover the vast majority of our library’s CSS rules for space: padding, margin, left, right, top, and bottom. These concepts also enhance how each atomic is self-contained, improving composability.
Please refer at the bottom of this page (Spacing scale) for token naming explanation.
Image
TYPE
2
Article title more text in this area to test
3
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
An inset offers indents content on all four sides. It’s use is widespread, across many components at varying sizes. Example: $spacing.zeta.square.m
Squish
Content
A squished inset reduces space top and bottom, in our case by 50%. While less common than its squared counterpart, a squish occurred frequently in elements (like a button) and cell-like containers like a data table or list item. Example: $spacing.zeta.squish.m
Stack
Content
Content
With all due respect to horizontally scrolled UI, the overwhelming majority scroll vertically. And that means one thing: we stack things. We stack message on heading on data table. We stack modules in rails. We stack copy, pills & toolbars, all in a card, each in a grid. Heck, infinite scroll means infinite stack! We stack, stack, stack. Example: $spacing.zeta.stack.m
Inline
Content
Content
We also arrange objects inline, wrapping as they flow like text from the left or right. Such objects — pills, tags, breadcrumbs, and more — may stand alone or stack and mingle with other objects. Example: $spacing.zeta.inline.m
Grid
Content
Content
Content
Content
Content
Content
Content
Content
Content
Use grid spacing for symmetrical gutter widths and heights. Example: see grid.
Use the spacing 4px scale when building individual components. It includes small increments needed to create appropriate spatial relationships for detail-level designs. This scale should applied and be used within all Zeta components.
We have also introduced tokens that use a more human language like T-shirt sizes and spatial naming concepts, as yoy may already noticed from the examples above.
The spacing scale can be applied to margin or padding properties, as well as to both vertical and horizontal edges following a more traditional CSS box model.