Design with Primer
Start with the job someone opens the screen to do. Choose the closest Fable composition, then implement it with the application’s own markup, controls and navigation. The selected Fable references describe visual intent. Primer’s semantic roles and foreground pairs govern implementation.
| If the person is… | Start here | Decision to preserve |
|---|---|---|
| Moving between destinations or comparing groups | Workspace | Separate navigation from the working surface. Give each group a clear heading. |
| Scanning many similar items and acting on one | Inbox | Align titles for scanning. Keep actions and metadata secondary. |
| Reading or editing one item | Reading page | Give the title and prose one column. Disclose supporting details. |
Make a choice
Section titled “Make a choice”- Surface. Start with one paper surface. Separate sections with a heading and space. Draw a boundary when it identifies an independently actionable object, an input or a floating layer. On a feed, a flat row usually communicates its place through alignment alone.
- Emphasis. Pick the one action or current context worth noticing first. Give it the accent when that helps. Give the current navigation item a quiet neutral fill and an accessible current state. Reserve critical colors for critical meaning.
- Typography. Start with Geist and the interface roles. Use the reading size and measure for paragraphs. A task list or a table can use the space its contents need. Align titles and let long titles wrap before yielding space to optional metadata.
- Density. Compact visuals and comfortable touch areas coexist. At narrow widths, change the arrangement, wrap controls and keep a route to secondary actions. An empty group can stay empty. Add explanatory copy when it tells someone what to do.
- Artwork. A compact cover can identify a document. Omit the art slot when the item has no artwork. Keep short icon motion tied to a deliberate action, with a static resting state for reduced motion.
Apply the contract
Section titled “Apply the contract”Search the bundle’s contract.json by public role or component name. Each token has a css variable and a resolved value. Specs name the control classes’ roles. Copy the recipe’s screen specimen and keep its classes. Load tokens.css, styles/type.css, and styles/controls.css in that order, then styles/controls.js. Preserve the relative font path, set data-primer-theme="system" on the root, and use the primer class on the app. Support explicit light and dark as the product requires. Do not write a raw color, a raw length, or a new primer- class.
| Class | Use |
|---|---|
primer-workspace, primer-nav, primer-nav-toggle, primer-nav-backdrop |
Shell, destinations, and the narrow drawer |
primer-main, primer-toolbar, primer-group |
Working surface, toolbar, and grouped sections |
primer-button |
Primary action. Add primer-button-secondary, primer-button-outline, primer-button-ghost, primer-button-link, or primer-button-destructive. Add primer-button-small or primer-button-large for the label size. |
primer-field, primer-input, primer-field-error |
Label, field, and validation message |
primer-list, primer-row, primer-row-title, primer-row-meta |
Scannable row |
primer-folio, primer-folio-art, primer-folio-copy, primer-folio-title, primer-reading |
Document header and reading column |
| For this job | Use these roles |
|---|---|
| Outer workspace and navigation | color.shell.canvas, color.shell.panel |
| Document, raised state, supporting copy | color.background.base, color.background.strong, color.text.subdued |
| Readable accent text, filled primary action | color.accent.base, or the pair color.accent.fill and color.accent.on-fill |
| Keyboard focus | color.focus on a visible indicator around the active control |
For a web app, use the web workspace roles at every window size. A wide browser window still uses workspace.sidebar, workspace.shell-gap, shell.radius.panel and the layout.* content measures. The desktop.* roles belong to an explicitly chosen native desktop profile. Include the workspace recipe whenever a list or reader sits inside navigation.
Use one accent at a time. Vivid orange is for decoration. Resolve color through roles in both appearances. Use the app’s existing framework, icons, shortcuts and data model. A product with two views may only need two links. Add a shared token or change a spec in Primer when a new cross-app decision is necessary.
Look at the result
Section titled “Look at the result”Open a populated view and an empty or filtered view. Try a long title at desktop and phone widths. Tab to the primary and secondary actions, open one, dismiss it and check where focus returns. Check light and dark surfaces and reduced motion if anything animates. Compare the result with the screenshots in the chosen recipe. Name one decision carried over and any intentional difference. The kit checker rejects unknown names, raw colors, and raw lengths. These checks catch hierarchy, clipping, and interaction problems.