Spacing & Layout tokens

Space, size, radius, z-index, shadows and breakpoints.

Space

A 4px scale: 1 = 4px, 4 = 16px. Negative tokens (-2) exist for margins. Prefer padding="4" over raw numbers.

0
0px
0-5
2px
1
4px
1-5
6px
2
8px
2-5
10px
3
12px
3-5
14px
4
16px
5
20px
6
24px
7
28px
8
32px
9
36px
10
40px
11
44px
12
48px
14
56px
16
64px
20
80px
24
96px
32
128px

Size

Sizes reuse the spacing scale and add larger steps for layout boxes: 40 = 160px · 48 = 192px · 56 = 224px · 64 = 256px · 72 = 288px · 80 = 320px · 96 = 384px · 112 = 448px · 128 = 512px · 144 = 576px · 168 = 672px · 192 = 768px · 224 = 896px.

Radius

xs
sm
md
lg
xl
2xl
full
Radius presets (base value): none 0px · sm 4px · md 8px · lg 12px · xl 16px. Try them in the customizer.

Shadows

Elevation presets map to shadow* props on iOS/web and elevation on Android:

shadows.xs
shadows.sm
shadows.md
shadows.lg
import { shadows } from '@advui/theme'

const Panel = styled(View, { ...shadows.md })

Breakpoints

Mobile-first flat values: <Stack flexDirection="column md:row" />. On web they compile to CSS media queries, so SSR output is stable.

Layout props such as Stack’s direction, Grid’s columns and Container’s gutter also take a map, from phones up: <Stack direction={{ base: 'column', md: 'row' }} />. A breakpoint you leave out keeps the value below it. For your own components, responsiveStyle turns such a map into media props.

Media keyMin widthTypical device
xs:460pxLarge phone
sm:640pxSmall tablet
md:768pxTablet
lg:1024pxLaptop
xl:1280pxDesktop
xxl: (2xl)1536pxLarge desktop

Z-index

base = 0 · dropdown = 1000 · sticky = 1100 · overlay = 1200 · modal = 1300 · popover = 1400 · toast = 1500 · tooltip = 1600Edit this page on GitHub