Spacing
The 4px-based spacing grid used for consistent layout and component sizing.
Base Unit
All spacing in the FRAYT Design System snaps to a 4px grid (0.25rem). This creates visual rhythm and ensures consistent alignment across all components and layouts.
Spacing Scale
0.50.125rem (2px)
10.25rem (4px)
1.50.375rem (6px)
20.5rem (8px)
30.75rem (12px)
41rem (16px)
51.25rem (20px)
61.5rem (24px)
82rem (32px)
102.5rem (40px)
123rem (48px)
164rem (64px)
205rem (80px)
246rem (96px)
Usage
Use Tailwind's spacing utilities, which are based on the same 4px grid:
// Padding
<div className="p-4">16px padding</div>
<div className="px-6 py-3">24px horizontal, 12px vertical</div>
// Margin
<div className="mt-8 mb-4">32px top, 16px bottom</div>
// Gap (flexbox/grid)
<div className="flex gap-3">12px gap between items</div>
<div className="grid gap-6">24px grid gap</div>Guidelines
- Component internal padding: Use
p-3(12px) top-6(24px) depending on density - Section spacing: Use
space-y-8(32px) orspace-y-12(48px) between major sections - Inline spacing: Use
gap-2(8px) togap-4(16px) between related inline elements - Never use arbitrary spacing values — always snap to the 4px grid