Spacing
A spacing system built on a 4px base unit — providing consistent rhythm across all components and layouts.
4
4px Base Unit
0–12px in 2px steps (fine adjustments), 12px and above in multiples of 4px.
Spacing Scale
Click to copy — full spacing scale from 0px to 96px (0–12px in 2px steps, 12px+ in 4px steps).
Visual Scale
2pxgap-0.54pxgap-16pxgap-1.58pxgap-210pxgap-2.512pxgap-316pxgap-420pxgap-524pxgap-6Component Spacing
Recommended spacing values for each component
Padding
Gap
Button
Button
16px|8px gap|16px
Padding X
16px
px-4Padding Y
auto
h-*Gap
8px
gap-2Input
Placeholder...
12/16px| content |12/16px
Padding X
12/16px
px-3/4Padding Y
auto
h-*Card
12px
Padding X
16→24px
px-4 sm:px-6Header Top
20→24px
pt-5 sm:pt-6Section Gap
12→16px
pb-3 sm:pb-4Footer Gap
8px
gap-2Modal
24px
24px
Padding
24px
p-6Footer Gap
12px
gap-3Badge
Badge
8px|4px gap|8px
Height
24px
h-6Padding X
8px
px-2Gap (Icon/Dot)
4px
gap-1Alert
16px|10px gap|16px
Padding
16px
p-4Gap (Icon↔Content)
10px
gap-2.5Layout Spacing
Recommended spacing patterns for page and section layouts — combine primitive tokens with responsive breakpoints.
Symmetric
DefaultX = Y same padding — for dashboards and apps
Padding
p-4 md:p-6 lg:p-8 xl:p-10| Breakpoint | Padding |
|---|---|
| Mobile | 16px |
| Tablet (md) | 24px |
| Desktop (lg) | 32px |
| Large (xl) | 40px |
Reading
Y > X more vertical spacing — for documents and blogs
Padding X
px-4 md:px-6 lg:px-8 xl:px-10Padding Y
py-5 md:py-8 lg:py-10 xl:py-12| Breakpoint | X | Y |
|---|---|---|
| Mobile | 16px | 20px |
| Tablet (md) | 24px | 32px |
| Desktop (lg) | 32px | 40px |
| Large (xl) | 40px | 48px |
Section
Large section gaps within a page (responsive)
Gap (Between Sections)
gap-4 md:gap-6 lg:gap-8| Breakpoint | Gap |
|---|---|
| Mobile | 16px |
| Tablet (md) | 24px |
| Desktop (lg) | 32px |
Element
Between elements within a section
16px
16px
Gap (Between Elements)
16px
gap-4Inline
Between horizontally arranged elements
Item
Item
Item
8px gap between items
Gap (Inline)
8px
gap-2Interactive Demo
p-14px
p-28px
p-416px
p-624px
p-832px