Skip to content
Primer printing platePrimer

Native desktop foundations

The opt-in desktop foundations give Wick a calmer native shell and provide the same roles for Tally, Fable, or another desktop client. The desktop patterns document shared decisions grounded in Tally and Fable: stable left navigation, quiet surfaces, focused actions, and content that has room to breathe. The reference audit distinguishes inspected application behavior from the new shared contract. Things and Craft remain earlier composition references; the two local applications now provide the concrete cross-app evidence.

The open-canvas profile supplies white or charcoal surfaces, lavender selection, and generous content measures. It supports left navigation as well as a toolbar-only shell. The default now uses Fable-derived neutral foundations, Geist, and orange. Existing desktop profile attributes and role names remain supported; the open-canvas profile remains an explicit composition choice.

Applications still own React components, navigation, layouts, keyboard behavior, and native window chrome. This profile is a stylesheet and a token contract, not a component library.

Copy dist/tokens.css and styles/desktop.css from the same Primer revision to src/primer/tokens.css and src/primer/desktop.css in your app. From an entry point in src/, load the tokens first.

import './primer/tokens.css';
import './primer/desktop.css';
<html class="primer-desktop"
data-primer-theme="system"
data-primer-density="comfortable"
data-primer-layout="open-canvas"
data-primer-accent="violet">

Set data-primer-theme to light, dark, or system. System follows the operating system without JavaScript; an app may resolve its persisted appearance preference explicitly before mounting. Put the accent on the same element as the theme. Violet complements the open-canvas profile; green, amber, and blue are also available, and orange is the default when the attribute is omitted; brown is an explicit alternative. Theme attributes may also scope a subtree.

Record the source revision and file checksums with the copied styles. Geist is bundled locally by the type stylesheet. Copy its font file and notice when using that font; system fallbacks remain available.

Use a labeled left rail when people need readable, persistent access to a handful of destinations. A compact icon rail is an alternative for a few familiar destinations. Keep global identity and search near the top, primary destinations in a stable order, and utilities near the bottom. The page owns local search, filters, and actions. Do not repeat the primary navigation across the top of the page.

The desktop.navigation.* roles provide shared dimensions independently of the content density and surface profile. They do not activate a layout or require another root attribute. Wick consumes the labeled composition; Tally and Fable remain reference applications with their own implementations and themes.

Role suffix after --primer-desktop-navigation- Shared reference
width, width-narrow 240px labeled navigation; 220px at smaller desktop widths
compact-width 64px icon rail
target-size 44px minimum target in either composition
icon-size, label-size 20px glyph box; 14px visible labels
inset 12px inner edge for labeled navigation
item-gap, group-gap 4px within a group; 24px between groups

These are the shared comfortable reference, not claims that both reference apps currently use these exact dimensions. For example, Tally’s compact rail is narrower. Keep verified product measurements and intentional exceptions in the reference audit. The older desktop.sidebar-width density roles retain their existing values for compatibility; new rail compositions consume desktop.navigation.*. layout.rail remains a contextual content measure and does not mean left navigation.

.workspace-navigation {
box-sizing: border-box;
width: var(--primer-desktop-navigation-width);
padding-inline: var(--primer-desktop-navigation-inset);
background: var(--primer-desktop-sidebar);
}
.workspace-navigation-group {
display: grid;
gap: var(--primer-desktop-navigation-item-gap);
}
.workspace-navigation-group + .workspace-navigation-group {
margin-block-start: var(--primer-desktop-navigation-group-gap);
}
.workspace-navigation-item {
min-height: var(--primer-desktop-navigation-target-size);
font-size: var(--primer-desktop-navigation-label-size);
}
.workspace-navigation-item svg {
width: var(--primer-desktop-navigation-icon-size);
height: var(--primer-desktop-navigation-icon-size);
}

The application supplies sizing, scrolling, the narrow breakpoint, and focus behavior. At smaller desktop widths, use width-narrow before reducing the page’s text or targets. If readable navigation and content still cannot fit, choose a compact rail or a named navigation layer. Do not infer a compact mode merely by hiding labels; every destination still needs an accessible name, current-state cue, and hover/focus tooltip. A navigation layer must support Escape, focus containment when modal, and focus restoration. Preserve active destination, open drafts, selection, and content scroll.

Use nav with a clear label and aria-current="page" on the active destination. Native links are preferred when a real destination URL exists; local desktop routing can use buttons. Do not use tablist for global navigation. Each selected item has a non-color cue as well as the selected fill. Native window controls and dragging remain separate from interactive content.

The side-rail specimen demonstrates the labeled and compact compositions beside Home, People, and Tools. The desktop-navigation spec and pattern handbook describe the behavior contract. Specimens are application-owned examples, not exported components.

Use data-primer-layout="open-canvas" alongside comfortable density for the spacious workspace foundations. The layout attribute remaps desktop surface, selection, and content roles. The density attribute supplies the 15px body, 44px controls, 48px content rows, and generous insets. Violet is independently opt-in, so other consumers can adopt dimensions without changing their accent or theme. Attributes change foundations; they do not select a navigation composition or create columns and React components.

Role suffix after --primer-desktop- Open canvas
canvas White in light; charcoal #202124 in dark
sidebar, toolbar Quiet gray #f6f6f8 in light; #2b2c30 in dark
selection, selection-text Pale lavender and violet text in light; muted violet and lavender text in dark
toolbar-height 64px
content-width 1040px content measure, excluding outer page insets
title-size 36px; 32px at widths up to 1050px
detail-width 300px; 240px at widths up to 1050px
context-space 32px; 24px at widths up to 1050px

Choose one primary navigation composition: a labeled left rail, a compact rail, or a short toolbar-only navigation row. The first two keep location stable beside content. The toolbar alternative is still useful for an app with a small number of top-level destinations. Keep the active destination clear with aria-current, weight or another non-color cue, and selection. Local content tabs use tab semantics only when their behavior implements the tab pattern. Native traffic lights and window dragging remain app-owned and must not overlap controls.

Build the page from a title, a short supporting line when helpful, and open content sections. A list can sit beside useful context such as saved places or the selected person’s details. Separate those columns with space and one hairline. Tools can use plain disclosure rows with inline fields. Reserve raised surfaces for dialogs, menus, or layers that need separation. Avoid turning every section or action into a bordered card.

The content measure excludes page insets. This app-owned recipe keeps the intended room around a 1040px content area:

.workspace-content {
padding: var(--primer-desktop-content-space);
}
.workspace-content-inner {
max-width: var(--primer-desktop-content-width);
margin-inline: auto;
}
.workspace-context-layout {
display: grid;
grid-template-columns: minmax(0, 1fr) var(--primer-desktop-detail-width);
gap: var(--primer-desktop-context-space);
}

Applications choose when to stack or temporarily dismiss contextual detail. Reclaim margins before shrinking controls. At narrow widths keep all destinations and detail reachable, preserve focus, and allow long names to wrap. The open-canvas specimen retains the toolbar-only alternative for Home, People, and Tools in both appearances; the side-rail specimen demonstrates the same content foundations with left navigation.

Use data-primer-density="comfortable" on the .primer-desktop root. The stylesheet remaps the shared desktop roles; application components consume those roles for their own sizes and layouts. It does not create a sidebar, resize every button automatically, or hide controls.

Role suffix after --primer-desktop- Base profile Comfortable profile
font-size 13px 15px
supporting-size 13px 13px
control-height 36px 44px
row-height 36px 48px
sidebar-width 240px 260px; 220px at widths up to 1050px
content-width 1120px 960px
content-space 32px 48px; 24px at widths up to 1050px
section-space 24px 40px

Heights are minimums: supporting copy and long labels must grow the row. Narrow windows reclaim margins before reducing text or control targets. The width role is a reading measure; full-width editors, canvases, and data tables can exceed it when useful. The base profile and global prose scale retain their previous values.

The underlying desktop.density.comfortable.* tokens are available independently of the class. Tally and Fable can use these spacing and sizing decisions while retaining their own color themes and React components. Opting into the complete .primer-desktop profile also applies Primer’s native font and semantic color roles; adopting dimensions alone does not require changing an app’s theme.

Custom property suffix after --primer-desktop- Use
canvas, sidebar, toolbar Workspace canvas, quiet navigation, and native toolbar
surface, inset Grouped paper content and recessed supporting areas
text, muted, subtle Primary, supporting, and tertiary readable copy
border, separator Identifiable control boundaries versus decorative hairlines
accent, accent-fill, accent-fill-hover, on-accent Accent text and paired filled actions
selection, selection-text Selected-row and quiet-action pair, with aria-current and a visible non-color cue
focus Solid keyboard focus indicator
radius-control, radius-panel 8px controls and 16px grouped surfaces
shadow-control, shadow-panel Optional quiet elevation; use only where it clarifies a layer
font-size, supporting-size Working interface text and supporting labels
control-height, row-height, sidebar-width Minimum control and row heights, plus navigation width
content-width, content-space, section-space Reading measure, page inset, and separation between content groups
toolbar-height, title-size, detail-width, context-space Window toolbar, page title, and contextual-column composition
navigation-* Independent labeled/compact rail dimensions; see the left-navigation table above

These are app-owned selectors using Primer roles, not exported component classes:

.workspace-page {
box-sizing: border-box;
width: 100%;
padding-inline: var(--primer-desktop-content-space);
}
.workspace-section + .workspace-section {
margin-block-start: var(--primer-desktop-section-space);
}
.workspace-row {
display: flex;
align-items: center;
gap: var(--primer-space-base);
min-height: var(--primer-desktop-row-height);
padding-block: var(--primer-space-small-200);
font-size: var(--primer-desktop-font-size);
}
.workspace-row small {
font-size: var(--primer-desktop-supporting-size);
color: var(--primer-desktop-muted);
}
.workspace-nav [aria-current="page"] {
background: var(--primer-desktop-selection);
color: var(--primer-desktop-selection-text);
font-weight: var(--primer-font-weight-bold);
}
.workspace-quiet-action {
min-height: var(--primer-desktop-control-height);
color: var(--primer-desktop-muted);
background: transparent;
}

A calm interface starts with a small number of choices. Keep the persistent destination list short and make occasional destinations reachable through a named, searchable picker. The correct count follows the product’s jobs and actual usage, not a quota of visible controls. When the active view is outside the main list, name it in the page and keep its current location apparent in navigation. Preserve direct links and keyboard access to every view. The desktop patterns explain how global navigation, saved places, local tabs, and contextual detail work together.

Group content with whitespace and typography. Use plain sections for related information; reserve borders and raised surfaces for boundaries and separate layers that need them. A Home page should show genuine recent items, saved places, or useful next actions. Do not invent activity or turn configuration status into permanent dashboard furniture.

Keep a clear primary action. Secondary actions may live in a labeled menu. Row actions can appear on hover and :focus-within when touch users have an equally discoverable route. Focused controls must remain visible, and collapsing navigation must not discard an open form. Native traffic-light clearance and draggable title-bar regions stay in the application, away from interactive content. See specs/desktop-shell.yaml for the composition contract.

The desktop density specimen demonstrates an app-owned page, list, and navigation using these roles. It includes theme, accent, and density controls for checking the same composition across consumers; it is a reference, not an exported component library.

The compiler checks readable text, accent, and status foregrounds at 4.5:1 on every desktop surface, including open-canvas navigation and its toolbar; selection text at 4.5:1 on its fill; and control boundaries and focus at 3:1 on desktop surfaces. Every available accent is checked in both appearances. Focus also clears 3:1 on a selected row. separator is decorative and has no control-boundary guarantee. Use selection-text for copy on the lavender selection fill; do not substitute supporting copy without checking its contrast.

The stylesheet supplies visible focus, selection foregrounds, and reduced-motion behavior. Apps must verify labels, keyboard order, selected-state semantics, responsive wrapping, scroll access, zoom, and both appearances in their actual UI. Those interactions cannot be guaranteed by a foundation stylesheet.

For decorative page covers and consistent library icons, see Desktop artwork and interface icons.

For reusable operational page composition, see Workspace hierarchy and rhythm. The hooks work with an open canvas and do not require a page card.

The newer workspace.* roles capture the selected 272px navigation, narrow drawer, touch targets, and Compact folio proportions independently of the earlier desktop density recipes. See Fable-derived foundations and component guidance.