import { Meta } from 'storybook/blocks';
# Spacing System
Our spacing system uses a consistent scale to create harmonious layouts and maintain visual rhythm.
## Spacing Principles
1. **8px Base Unit**: All spacing values are multiples of 8px for consistency
2. **Semantic Naming**: Use purpose-based names for clarity
3. **Responsive Design**: Spacing can adapt to screen sizes
4. **Predictable Scale**: Each step is proportionally larger
## Spacing Scale
| Token | Value | Pixels | Use Case |
|-------|-------|--------|----------|
| `none` | 0 | 0px | No spacing |
| `xs` | 0.125rem | 2px | Minimal gaps |
| `sm` | 0.25rem | 4px | Tight spacing, icon margins |
| `md` | 0.5rem | 8px | Default small spacing |
| `lg` | 1rem | 16px | Component internal padding |
| `xl` | 1.5rem | 24px | Section spacing |
| `2xl` | 2rem | 32px | Large gaps |
| `3xl` | 3rem | 48px | Major section spacing |
| `4xl` | 4rem | 64px | Page-level spacing |
| `5xl` | 6rem | 96px | Hero sections |
| `6xl` | 8rem | 128px | Maximum spacing |
## Visual Scale
```
xs: ██
sm: ████
md: ████████
lg: ████████████████
xl: ████████████████████████
2xl: ████████████████████████████████
3xl: ████████████████████████████████████████████████
```
## Component Spacing
### Padding Guidelines
| Component | Padding |
|-----------|---------|
| Button (small) | `py-2 px-3` (8px / 12px) |
| Button (medium) | `py-2.5 px-4` (10px / 16px) |
| Button (large) | `py-3 px-6` (12px / 24px) |
| Input | `py-2 px-3` (8px / 12px) |
| Card | `p-6` (24px) |
| Modal body | `p-6` (24px) |
| Table cell | `p-4` (16px) |
### Margin Guidelines
| Element | Margin |
|---------|--------|
| Heading after heading | `mt-2` (8px) |
| Paragraph after paragraph | `mt-4` (16px) |
| Section spacing | `mt-8` or `mt-12` |
| Form field gap | `gap-4` (16px) |
| Button group gap | `gap-2` (8px) |
## Layout Spacing
### Page Layout
```tsx
// Standard page layout
Page Title