Spacing
Choose spacing by relationship: details stay close, components breathe, and sections mark task boundaries.
Start with relationships
Spacing explains which elements belong together. Choose the relationship before the number, and use one repeated gap for peers.
- Detail spacing (
xs–sm): icon and label, label and value, or lines inside one compact group. - Component spacing (
md–lg): fields, actions, rows, and padding inside a bounded component. - Section spacing (
xl–2xl): task groups, page regions, and major changes in subject.
Visual scale
3xs0.0625remxs0.25remsm0.5remmd0.75remlg1remxl1.5rem2xl2rem3xl3remLayout rhythm
Build from the inside out: group label and value with xs, separate peer rows with sm or md, pad the component with lg, then separate it from the next task with xl or 2xl. Avoid a different gap for every pair; repeated relationships should look repeated.
Rackrack-a
StatusHealthy
Rhythm
Detail gaps bind each label and value. Component gaps separate rows. Section gaps separate tasks.
Implementation and reference
.rack-card { display: grid; gap: var(--tinyrack-space-md); padding: var(--tinyrack-space-lg); }
| Token | Value | Typical relationship | Tailwind | TypeScript |
|---|---|---|---|---|
3xs | 0.0625rem | Detail | gap-tinyrack-3xs | tinyrackSpacing['3xs'] |
xs | 0.25rem | Detail | gap-tinyrack-xs | tinyrackSpacing['xs'] |
sm | 0.5rem | Detail | gap-tinyrack-sm | tinyrackSpacing['sm'] |
md | 0.75rem | Component | gap-tinyrack-md | tinyrackSpacing['md'] |
lg | 1rem | Component | gap-tinyrack-lg | tinyrackSpacing['lg'] |
xl | 1.5rem | Section | gap-tinyrack-xl | tinyrackSpacing['xl'] |
2xl | 2rem | Section | gap-tinyrack-2xl | tinyrackSpacing['2xl'] |
3xl | 3rem | Section | gap-tinyrack-3xl | tinyrackSpacing['3xl'] |
See the Tailwind spacing mappings.