Skip to content
Primer printing platePrimer

Workspace hierarchy and rhythm

This opt-in composition makes operational views feel related without forcing tables, editors and maps into the same layout. It draws on Wick’s task views and Fable’s separation of page, section and item hierarchy. Tally and Fable can adopt the hooks incrementally; their themes and runtime components are unchanged.

Import tokens.css, then desktop.css. Set data-primer-workspace on the content region. This does not add a card, background or scroll container. It works with an open canvas or the optional page surface. Applications retain markup, data, behavior, landmark semantics, widths and platform window regions. These are CSS hooks, not new Web Components.

Role Shared token Value
Page title desktop.workspace.title-size 30px
Section heading desktop.workspace.section-title-size 18px
Item title desktop.workspace.item-title-size 16px
Supporting text desktop.supporting-size Existing theme/density value
Section break, total desktop.workspace.section-gap 32px
Heading to content desktop.workspace.heading-gap 16px
Related labels or controls desktop.workspace.related-gap 8px
Table cell vertical inset desktop.workspace.row-space 12px
Page inset, wide / narrow desktop.workspace.page-inset / page-inset-narrow 48px / 24px

Keep one page title. Use a section heading for a distinct task and an item title for a row or selectable object. Use font size and weight before adding separators. Numeric readings can remain larger than section headings; their labels establish their meaning.

<main class="primer-desktop">
<div data-primer-workspace>
<header data-primer-part="page-heading">
<div>
<h1>Projects</h1>
<p data-primer-part="description">Keep your projects in order.</p>
</div>
</header>
<div data-primer-part="toolbar">
<span>Two projects need attention</span>
<button data-primer-action="primary">Check for updates</button>
</div>
<p data-primer-part="status" role="status"></p>
<h2 data-primer-part="section-heading">Projects to review</h2>
<!-- Application-owned list or table -->
</div>
</main>

The stylesheet supplies part typography, spacing and action color pairs. Applications supply button geometry, disabled states and interaction. status collapses when empty. Keep its live-region semantics in the app; use data-tone="critical" when a message requires corrective action. Color supplements an explanatory message. A recoverable partial reading is a notice, not a reason to recolor the entire page.

Use data-primer-part="empty" for a genuine empty state with a heading, short explanation and optional next action. Keep loading feedback compact rather than presenting it as an empty state.

Let one wrapper own the working width and align page titles with section content. A map or editor may fill that width while prose keeps a readable measure. Avoid independently centering each view to slightly different widths.

Count a section break once: use 32px whitespace, or split 16px margin and 16px padding around a hairline. Do not add a full section gap to both sides of the same separator. Use modest table-row padding and reserve larger gaps for changes of task. Keep toolbars near the content they affect and allow actions to wrap at narrow widths.

Use one clearly emphasized next action within the visible task. For an empty repository list that is Add repositories; for a populated list it can be Check for updates. Refresh and inspection controls stay secondary. Destructive or irreversible actions retain their explicit review flow. Do not paint all buttons with the accent.

Status messages occupy space only when present. Do not reserve a blank status row between a toolbar and its list. Persistent operational explanations belong in help or a disclosure, rather than competing with current work.

Wick maps its existing operational headings, records, local tabs, tables and empty states to these roles in its workspace composition stylesheet. Its layout exceptions remain app-owned. Review light/dark, desktop/short/narrow windows, real labels, focus, dialogs, and wrapping. The token compiler verifies the existing semantic foreground/fill pairs; source inspection alone does not prove layout or interaction.

Use data-primer-part="local-views" on a local navigation row. The shared selected treatment recognizes both aria-current="page" on route-like buttons and aria-selected="true" on real tabs. Apps retain the correct semantics and keyboard behavior; styling does not turn buttons into a tab widget. Selection and hover have distinct fills, and focus keeps its own outline.

Use data-primer-part="metrics" for a set of four summaries. It uses four columns when space permits and two columns when the containing workspace is 640px or narrower (with a viewport fallback). Avoid a three-plus-one orphan layout. Long labels wrap; values keep their existing semantic scale.

Show the user’s current work before optional configuration. A saved review should open to its content, with folder settings and optional assistance behind named disclosures. Keep consequential action summaries in the document flow so they do not obscure controls. Present review actions when there is a selection or an undoable operation; preserve explicit confirmation before changes.

Completed output grows with its content up to a scrollable limit. Running work may reserve a modest log region, while short completed results should not become a large empty terminal. Persistent freshness information belongs beside Refresh; reserve global notices for conditions requiring attention.