Spacing and size

Overview

Wave uses comprehensive size, spacing and border radius scales.

As much as possible, Wave tries to make use of this scales rather than generating custom sizing rules to ensure more harmonious and organized visual layout.

All our sizing values are set in rem.

If you need to translate rem sizes to pixel sizes, multiply rem value by 16.

Size tokens#

Size tokens are anchored around base spacing unit of 0.25rem, which translates to 4px by default in browsers. Size tokens follow one base unit increments for smaller dimensions, and up to four base unit increments for larger dimensions.

Token
Size
PX Size
Preview
2
0.125rem
2px
4
0.25rem
4px
6
0.375rem
6px
8
0.5rem
8px
12
0.75rem
12px
16
1rem
16px
20
1.25rem
20px
24
1.5rem
24px
28
1.75rem
28px
32
2rem
32px
36
2.25rem
36px
40
2.5rem
40px
44
2.75rem
44px
48
3rem
48px
64
4rem
64px
72
4.5rem
72px
80
5rem
80px
96
6rem
96px
112
7rem
112px
128
8rem
128px

Usage#

Size scale values can be applied to common CSS dimensions properties such as width, height, maxWidth or maxHeight.

Spacing tokens#

Spacing tokens are selection of values from the size tokens above. Values on the scale are non-linear with a progressively larger increment each step. Spacing tokens can be used inside of components and between components for layout spacing.

Token
Size
PX Size
Preview
spacingXs
0.25rem
4px
spacingS
0.5rem
8px
spacingM
1rem
16px
spacingL
1.5rem
24px
spacingXl
2rem
32px
spacingXxl
3rem
48px
spacingXxxl
4.5rem
72px

Usage#

Spacing scale values can be applied to common CSS layout spacing properties such as margin, padding or gap. To create the space around components, it's recommened to use Flex layout component.

Radius tokens#

Border radius tokens define the standard corner radius of the components.

Different sizes of border radius are used according to the component size. Smallest radius is used for small components such as input fields, while medium radius is used for more prominent elements such as large buttons or dialogs.

Token
Size
PX Size
Preview
xs
0.25rem
4px
s
0.375rem
6px
m
0.5rem
8px
l
0.75rem
12px
xl
1rem
16px
full
100vh

Usage#

Border radius values can be applied to borderRadius CSS property.