Spacing
We will be updating this content to our new principle-based format in the near future.
Spacing is a key (and often overlooked) aspect of ensuring your application is easy to read and understand. Too little whitespace will cause components to become visually cramped, therefore decreasing readability. The general rule is to start with whitespace that is too large for an element and then decrease it until it is at an appropriate size. It is far better to have too much whitespace than too little.
1Dense User Interfaces
Sometimes interfaces (particularly dashboards or data heavy components) need to have a more condensed UI to ensure all information is presented to the user. This is a tradeoff with readability, so try to use this sparingly.
2The Spacing Scale
By reducing application Spacing to a predetermined scale, it is easy to ensure all elements and components are spaced in proportion to each other, rather than with arbitrary values.
The Spacing Scale values, much like the Typography Scale values, doesn't increase in a linear fashion. This is because as elements get positioned further apart, the difference between adjacent values becomes less noticeable. Whilst the Scale values itself increases non-linearly, the Scale is linear. This is to help developers quickly adjust spacing, without having to worry about the underlying Spacing API values.
Scale | Size | px value |
---|---|---|
1 | 0.125rem | 2px |
2 | 0.25rem | 4px |
3 | 0.375rem | 6px |
4 | 0.5rem | 8px |
5 | 0.625rem | 10px |
6 | 0.75rem | 12px |
7 | 0.875rem | 14px |
8 | 1rem | 16px |
9 | 1.125rem | 18px |
10 | 1.25rem | 20px |
11 | 1.5rem | 24px |
12 | 2rem | 32px |
13 | 2.5rem | 40px |
14 | 3rem | 48px |
15 | 4rem | 64px |
16 | 5rem | 80px |
17 | 6rem | 96px |
18 | 8rem | 128px |
19 | 9rem | 144px |
20 | 10rem | 160px |
px | 1px | - |
full | 100% | - |