Most spacing in the mobile app is the platform's: cell insets, bar heights, section gaps and safe areas are never written. The values on this page are the ones the app writes itself, in the content it paints. They were counted across the nine Contract files, so the scale below is what is built, not what was planned.
Gaps
gap= is the space between children of a row or column.
Gap | Uses | Typical meaning |
|---|---|---|
8 | 48 | The default: symbol to label, text to button, stacked parts of a card |
4 | 21 | Title to its secondary line in agent, tool and status rows |
2 | 14 | Title to its secondary line in Me, Server and Vault rows; empty-row headline to sentence |
12 | 13 | Avatar or thumbnail to text; between query cards; between sections of a panel |
6 | 12 | Small symbol to its label; name to timestamp; parts of an embed card |
10 | 3 | Avatar to comment body in DiscussBubble; media row; compose sheet |
14 | 1 | Between comments in a Thread |
3 | 1 | Symbol to number in CommentCount |
Two title-to-subtitle gaps are in use, 2 and 4. Inferred from which files use which: the me package uses 2, the agents and activity packages mostly 4. A new row should match its neighbours.
Padding
Value | Uses | Where |
|---|---|---|
20 | 5 whole, 6 as the side of a longer value | The side gutter of every reading column; sheet bodies |
16 | 7 whole, 5 as a side | StatusLine and AgentError; transcript rows; the 16-point margin of tool and run cards |
12 | 4 whole, more inside shorthands | Card interiors (query card, media row, tool and run cards); bubble sides |
24 | 3 whole, 2 as a top | Around a whole-screen EmptyState; above "In this space" and "Discussion" |
14 | 1 whole, 2 as a side | Embed card; code block sides; the "In this space" panel sides |
8 and 10 | Row padding | 8 above and below Activity and author header rows; 10 above and below DocItemRow and DiscussThreadRow |
6 | Block spacing | 6 above and below each document block ( |
40 | 3 | The bottom of a content list, so the last line clears the tab bar; the top of the compose sheet's no-identity panel |
Vertical rhythm in a document: 6 points above and below each block, 8 extra above a subheading and 16 above a top-level heading, 24 before "In this space" and before "Discussion", 40 at the end.
Indents
One indent step is 16 points: per nesting level of a document block, per depth in the Directory, and per reply depth in a thread (from the second level). A reply's "Reply" button and reply count are indented 38 points, which is the 28-point avatar plus the 10-point gap, so they align with the bubble.
Radii
Radius | Uses | Where |
|---|---|---|
10 | 6 | Blocks inside content: code, image, media row, DocItemRow thumbnail, tool card, run card |
12 | 3 | Cards that link to a document: embed card, DocCard, the "In this space" panel |
18 | 2 | Bubbles: comments and chat messages |
20 | 2 | The two composer fields |
999 | 2 | Pills: "Add a comment", a document's button block |
50% | 4 | Circles: Avatar (image and disc), the FacePile ring, the unread dot |
8 | 1 | The cover image inside an embed card |
DESIGN.md names "10 (cards, images, code), 18 (bubbles), full (avatars)". The 12, 20 and 999 radii came later with query cards, composers and pills. See Cards and panels.
Sizes, reading width and touch targets
Avatars are 56, 40, 28 or 20 points. Reading content is at most 40rem wide. Anything tappable that the app paints has a 44-point minimum. The full table of sizes is on Sizes, reading width and touch targets.
Do and do not
Do use 8 as the default gap and 20 as the reading gutter.
Do take a radius from the table by the kind of surface.
Do give any tappable thing you paint a 44-point minimum in both directions.
Do not write padding on a grouped list row to match these values. The cell's insets are the platform's.
User stories
This page helps deliver these stories. Each story lists this page in its Trace, so the link holds in both directions (traceability).
US-APP-04 Use the app with large text and assistive technology: Spacing scale, radii and sizes
Related
Typography, Accessibility, Lists, row, column and view, Leave it unsaid. Implementation: Shared components and visual design, Contract views and built-in calls. Source: the reading column at read.contract L321-L354, the bubble at discuss.contract L58-L67, the tool card at agents.contract L297-L311.
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime