Foundations · Spacing

Spacing & radius

Round 4 (locked): a 4-px base scale. Content-dense, breath at the section level, never airy at the component level.

Espanda is content-dense by design. Reach for tight tokens (1–4) inside components, generous tokens (12–24) at the section level. Skip the in-between sizes — that's where layouts get muddy.

Spacing scale

Visual reference. Each bar shows the actual pixel width of the token.

00
14px
28px
312px
416px
520px
624px
832px
1040px
1248px
1664px
2080px
2496px

When to use what

The same scale, with a sentence per token. Refer here when you're picking a value.

TokenValueUse for
00pxReset. Where two elements should touch with no gap.
14pxHairline spacing — between an icon and a label, between a meta-line and content.
28pxTight inline spacing — chip padding, badge padding, inline icons.
312pxCompact padding — small button vertical padding, tight form rows.
416pxDefault block spacing — space between paragraphs, default form-field gap.
520pxCard content padding — comfortable but compact.
624pxSection padding inside cards, default card padding for spacious cards.
832pxSection gap — between titled groups within a page.
1040pxGenerous block — between distinct content groups.
1248pxSection padding (small page) — vertical breathing room between major sections.
1664pxSection padding (default) — most page-level section gaps.
2080pxHero / marketing — generous vertical rest.
2496pxPage-level — top and bottom padding on long-form content.

Radius scale

Seven radius tokens. Default is 8 px. Most components use base or md.

none
0
sm
4px
base
8px
md
12px
lg
16px
xl
24px
full
full

When to use which radius

TokenValueUse for
none0Sharp corners. Tables, dividers, full-bleed surfaces.
sm4pxTight elements — chips, badges, small buttons, code inline.
base8pxDefault radius. Standard inputs, default buttons, alerts.
md12pxCards, popovers, dialogs — anything that should feel softly contained.
lg16pxLarger cards, hero blocks, prominent surfaces.
xl24pxMarketing hero blocks, splash sections. Use sparingly — too soft for product UI.
full9999pxPills, avatars, circular tag dots.

Composition patterns

Real layout recipes — the standard way to combine spacing tokens. Use these as defaults; deviate only when there's a real reason.

Card padding

6 (24px) all sides · gap-4 (16px) between blocks

Default card padding for product surfaces. Tight enough for density, comfortable enough for readability.

Section gap

mb-16 (64px) between sections · mb-6 (24px) between subsections

The vertical rhythm used throughout this design system site.

Form layout

space-y-4 (16px) between fields · gap-2 (8px) label-to-input · py-3 px-4 input padding

Compact, scannable, never airy.

Hero block

py-20 (80px) vertical · px-8 (32px) horizontal · mb-6 between heading and subheading

Marketing hero. Generous, but not Sarvam-blank.

Inline meta

gap-1 (4px) between icon and label · gap-2 (8px) between meta items

Status chips, breadcrumbs, file metadata, agent labels.

Page padding

px-8 (32px) mobile · md:px-12 · lg:px-16 · xl:px-20 · py-12 (48px) top/bottom

Already applied via the root layout in app/layout.tsx.

Rules of thumb

01

Pick from the scale. If your gap doesn't fit a token, the design is wrong, not the token.

02

Skip the in-between values. Don't reach for arbitrary px values. Half-step tokens (between 4–6, 8–12) lead to visual noise.

03

Tight inside components, generous between sections. Component density is a brand value. Section breathing room is a readability one.

04

Vertical rhythm follows the scale. Stack blocks at consistent gaps (4, 6, 8, 12, 16) — don't randomly mix 14 px and 18 px.

05

Radius defaults to base (8 px). Cards use md (12 px). Pills use full. Never reach for xl outside marketing.