Spacing
Every gap, padding and border comes from one scale on the 4px grid. Fine steps for the inside of components, wide steps for page layout, and no value outside them.
Usage
/* Spacing and border width are CSS custom properties.
Reach for a token; never write a raw pixel value. */
.card {
padding: var(--space-3xl);
gap: var(--space-xl);
border: var(--border-width-default) solid var(--border);
border-radius: var(--rounded-xl);
}// In Tailwind, use the numeric classes: each step is 4px, so p-2 = 8px and gap-4 = 16px
<div className="flex flex-col gap-4 rounded-xl border border-border p-6" />Click a token or class to copy it.
Spacing scale
| Token | Tailwind | Example | Value |
|---|---|---|---|
| · | 0 | ||
| · | 2px | ||
| · | 4px | ||
| · | 6px | ||
| · | 8px | ||
| · | 12px | ||
| · | 16px | ||
| · | 20px | ||
| · | 24px | ||
| · | 32px | ||
| · | 40px | ||
| · | 48px | ||
| · | 56px | ||
| · | 64px | ||
| · | 96px |
md (8px) is the default gap inside a component and xl (16px) the default between components. 2xs–lg are for the inside of components, xl–3xl for spacing between them, and 4xl and up for sections and page layout.
In context
Agent name
Model
CancelCreate agent
gap-2 (8px) · field → field gap-4 (16px) · card padding p-6 (24px) · buttons gap-2Border width
| Token | Tailwind | Example | Value |
|---|---|---|---|
| 0 | |||
| 1px | |||
| 2px | |||
| 4px |
1px is the standard border. 2px is for focus and active states; 4px is rare, for an accent edge such as a selected card.
Icon and icon-container sizes live on Iconography; corners live on Radius.
Guidelines
- Use a token or its Tailwind class, never a raw pixel value. Every gap, padding and border traces back to one step.
- Inside a component, default to 8px (
gap-2); between components, 16px (gap-4). - Group with space before lines: more space between groups than inside them, and a divider only when space isn't enough.
- Prefer
gapon the parent over margins on the children, so spacing stays in one place. - Don't use off-scale Tailwind steps like
p-2.5(10px),gap-7(28px) orp-[13px]. The only exceptions are inside a few components, tuned for optical balance: Button padding (10/14px), menu insets (28px) and Badge heights (22/26px). - Don't use 2px or 4px borders for decoration; thick borders mean focus, active or selected.