@dorsk/tsumikit / principles

Overview 01 Visibility of system status 02 One primary action per view 03 Emphasise by de-emphasising 04 Labels are a last resort 05 Tint your greys 06 Depth from shade, not outlines 07 One accent, used sparingly 08 A spacing scale, and more room than feels right 09 Group with space, not boxes 10 A real typeface, a fixed scale 11 Monospace only for code 12 Keep lines between 45 and 75 characters 13 Let imagery set the mood, keep the chrome quiet 14 Feedback is instant and calm 15 Prefer undo over confirmation 16 Empty states are design too 17 Errors say what happened and what to do next 18 Speak the user's language 19 Consistency beats local cleverness 20 Prevent errors before reporting them 21 Recognition over recall 22 Shortcuts for the experienced, defaults for the rest 23 The URL is state 24 Links are links, buttons are buttons 25 Every control shows a visible focus ring 26 Generous targets 27 Cheap motion, respected preferences 28 Less, but better 29 Colour is never the only cue 30 Help where it is needed

Design principles

The principles tsumikit is built to serve, one file each. They distil Nielsen's usability heuristics, Laws of UX, Refactoring UI, Practical Typography, the Vercel and Rauno Freiberg web interface guidelines, WCAG 2.2 and Dieter Rams. Each file states the principle in one line, why it holds (with the source), do and don't lists, what the kit provides for it, and a check you can run on a screen.

They ship in the package: node_modules/@dorsk/tsumikit/principles/. Point a design review, or a coding agent, at them.

Designing a screen: the checklist

Run through this before calling a screen done. Each line points at the principle with the full check.

  1. The first viewport answers "what is this, what state is it in, what can I do". (28, 21)
  2. Exactly one filled button; no action bar wraps at 40rem. (02)
  3. Three text levels at most; muted text passes 4.5:1. (03)
  4. Every label left on screen is one the value could not do without. (04)
  5. All greys tinted, layers told apart by shade, borders faint. (05, 06)
  6. Accent only on primary, active, focus, selection; status colours paired with a cue. (07, 29)
  7. Every gap and padding is a scale step; gaps between groups are larger than within. (08, 09)
  8. Bundled typeface, scale sizes only, mono only for code-like text, lines 45 to 75 characters. (10, 11, 12)
  9. Images fade into the page, text over them sits on a scrim, missing images get a placeholder. (13)
  10. Every click changes something within 100 ms; spinners appear after 200 ms and stay 500 ms. (01, 14)
  11. Destructive actions have undo, or a confirm that names the loss. (15, 20)
  12. Empty, filtered-empty and failed states each have copy and an action; errors say what to do next. (16, 17)
  13. Labels and messages read like a person talking; the same thing is named the same everywhere. (18, 19)
  14. Filters, tabs, sort and page are in the URL; navigation is real anchors. (23, 24)
  15. Tab through the screen: focus is visible everywhere; targets are 24px / 44px. (25, 26)
  16. No transition: all; reduced motion, zoom and paste all respected. (27)
  17. Help text sits beside the thing it explains; shortcuts are visible. (30, 22)
01

Visibility of system status

Every action gets an acknowledgement within 100 ms, and the outcome is stated, not implied.
Do
Synced
The spinner waits 200 ms and stays 500 ms; a 150 ms save never shows one.
Don't
Nothing acknowledges the click, so people click again.

Why

Nielsen heuristic 1: users forgive slowness but not silence; a button that goes quiet after a click gets clicked again or abandoned. The Doherty threshold adds the budget: below about 400 ms people stay in flow, above it they need visible progress.
Sources: https://www.nngroup.com/articles/ten-usability-heuristics/ , https://lawsofux.com/doherty-threshold/

Do

  • Change the control the moment it is pressed: keep its label, add a busy indicator next to it.
  • State the result in words ("Saved. 3 fields updated."), and offer the way back when there is one.
  • Show progress for anything that can take more than a second; show how much is done if you know.
  • Mark long-running background work somewhere persistent (a status bar, a queue count).

Don't

  • Disable the button and show nothing else.
  • Swap the label for a spinner, so the user forgets what they pressed.
  • Report success only by closing the dialog.

In tsumikit

  • Button with loading (true while pending, 'done' for the confirmation tick) and the pending() helper with loadingDelay / loadingMin for flicker-free timing.
  • Spinner, Progress, SegmentedProgress, Skeleton for in-place state; StatusBar for persistent status.
  • Toaster with toasts.info() / toasts.error() for outcome messages; errors use the assertive live region.
  • Motion tokens --dur-fast, --dur-base keep the acknowledgement under the 100 ms threshold.

Check

Click every action on the screen with the network throttled to "slow 3G". Within 100 ms something must change on or next to the control, and after completion the screen must say what happened.

02

One primary action per view

Each view has exactly one filled button, for the thing most people came to do; everything else is quieter or behind a menu.
Do
One filled button; Cancel is quiet. Lint rule one-primary checks this.
Don't
Two filled buttons compete; neither reads as the main thing to do.

Why

Hick's law: decision time grows with the number and complexity of choices. Two filled buttons cancel each other out, and an action bar that wraps is a bar with too many actions.
Sources: https://lawsofux.com/hicks-law/ , Refactoring UI (hierarchy of actions) https://www.refactoringui.com/

Do

  • Filled accent for the primary action, outlined for secondary, plain text or icon-only for tertiary.
  • Move rare or destructive actions into an overflow menu.
  • Keep the primary action visible in the first viewport.

Don't

  • Fill two buttons in the same toolbar.
  • Let an action bar wrap onto a second line.
  • Give the primary slot to "Cancel" or "Back".

In tsumikit

  • Button variant="primary" for the one filled button; variant="default" for secondary, variant="ghost" or IconButton for tertiary.
  • SplitButton when a primary action has variants; Menu for the overflow.
  • Toolbar lays actions out with the shared control height.
  • Lint rule one-primary flags more than one primary button in a view.

Check

Count filled buttons in each viewport-sized region of the screen. The answer is one. Then shrink the window to 40rem: no action bar may wrap.

03

Emphasise by de-emphasising

Make the important thing stand out by making everything around it quieter, not bigger.
Do

Quarterly report

Shared with 4 people Edited yesterday
Three text levels: default, muted, faint. The title stands out because the rest is quiet.
Don't

Quarterly report

Shared with 4 people

Edited yesterday

Everything is loud, so nothing is.

Why

Refactoring UI: hierarchy is built with weight and colour first, size last. When every element shouts, nothing does. Three text levels are enough for most screens: a title, values, labels.
Source: https://www.refactoringui.com/

Do

  • Title: large and bold. Value: normal weight, full contrast. Label: small, muted.
  • Lower the contrast of supporting text instead of raising the size of primary text.
  • Keep muted text at or above 4.5:1 contrast; faint text is for placeholders and disabled states only.

Don't

  • Use size alone to signal importance.
  • Use four or more text styles on one card.
  • Push secondary text so faint that it fails contrast.

In tsumikit

  • Text colour levels: --text for values, --text-muted for labels (>= 4.5:1), --text-faint for placeholder and disabled text only (~3:1).
  • Heading for titles; Text with tone="muted" for labels and variant="caption" for small supporting copy.
  • Weight tokens --fw-normal, --fw-semibold, --fw-bold (--fw-medium is a deprecated alias of semibold); size tokens --fs-xs to --fs-2xl.
  • KeyValue, Metric, StatTile already encode the title / value / label structure.

Check

Squint at the screen (or blur a screenshot). You should see one title, a few strong values, and quiet labels. Run a contrast check on muted text: 4.5:1 or better.

04

Labels are a last resort

Show a label only when the value cannot explain itself; when you do, make it small and quiet so the value carries the weight.
Do
Jane Doe jane@example.com Member since May 2024
The value explains itself; the one label left is small and muted.
Don't
Name: Jane Doe Email: jane@example.com Member since: May 2024
Labels repeat what the values already say.

Why

Refactoring UI: "Year: 2023" makes the eye scan words, "2023" alone reads as a fact. Labels at the same weight as values double the text and halve the information density.
Source: https://www.refactoringui.com/

Do

  • Drop labels where the format is self-evident: years, file sizes, durations, email addresses.
  • Fold the label into the value where it reads naturally ("3 files", "Korean audio").
  • When a label stays, set it small, muted, often uppercase and tracked, with the value in full contrast.
  • Lay out label and value pairs as a strip or grid that reads in one glance.

Don't

  • Write "Label: value" lists in the same weight and colour.
  • Separate related facts with " · " in a single run of text where a strip would scan faster.

In tsumikit

  • KeyValue renders muted label and strong value; Metric and StatTile for numeric facts.
  • Text variant="eyebrow" for small uppercase labels; tone="muted" for the label colour --text-muted.
  • --font-label and --font-numeric (default to sans; opt into mono for data-dense views).

Check

Read each label on the screen and ask whether the value would be ambiguous without it. Remove the ones that would not. Remaining labels must be visibly quieter than their values.

05

Tint your greys

Neutral greys look dead on screen; give every grey a slight shared hue so the whole page has one mood.

Why

Refactoring UI: pure greys read as "admin panel". Saturating them a little, cool or warm, makes the palette feel intentional. Material's tonal surfaces follow the same idea: surfaces are tinted shades of one hue.
Sources: https://www.refactoringui.com/ , https://m3.material.io/foundations

Do

  • Pick one hue for the whole neutral ramp and tint backgrounds, borders and muted text with it.
  • Keep lightness steps the same as a neutral ramp; only the hue changes.
  • Let the accent colour and the grey tint come from nearby hues so they agree.

Don't

  • Use #2a2a2a-style neutral hexes.
  • Mix cool greys in one component with warm greys in another.
  • Hard-code any grey in a component; read it from the theme.

In tsumikit

  • Theme ramps --c-bg, --c-bg-elev, --c-bg-elev-2, --c-surface, --c-border, --c-text-muted, --c-text-faint are tinted per theme; components read the semantic aliases --bg, --bg-elevated, --bg-elevated-2, --surface, --border, --text-muted.
  • ThemePicker and chooseTheme() switch the whole ramp at once; Swatch previews it.
  • Lint rule no-raw-color rejects hex or rgb literals in app styles.

Check

Sample three greys from a screenshot (background, card, border). Each must have non-zero saturation in HSL and the same hue family.

06

Depth from shade, not outlines

Layers are told apart by background lightness and soft shadow; borders are faint or absent.
Do
Storage 42 GB of 100 GB used
Surfaces differ by shade (surface raised, border none).
Don't
Storage 42 GB of 100 GB used
Nested boxes drawn with outlines.

Why

Refactoring UI and Apple's dark-mode guidance: in dark themes the base is near black and each level above it is a few percent lighter. When every panel has a strong border, the borders become the loudest thing on the page and the content loses.
Sources: https://www.refactoringui.com/ , https://developer.apple.com/design/human-interface-guidelines/

Do

  • Stack --bg < --bg-elevated < --bg-elevated-2 < --surface as you go up.
  • Use a single light direction for shadows and keep them soft.
  • Reserve visible borders for inputs and for cases where two equal-lightness areas must be separated.

Don't

  • Put a 1px solid border on every card, table and panel.
  • Combine a strong border with a shadow on the same element.
  • Lighten text and darken background in the same step; adjust one at a time.

In tsumikit

  • Elevation tokens --bg, --bg-elevated, --bg-elevated-2, --surface; --border for faint lines, --border-strong only where needed.
  • Shadow tokens --shadow-sm, --shadow-md, --shadow-lg.
  • Card reads surface fill and edge from --surface-fill / --surface-edge; look tokens --raised-fill, --overlay-fill cover popovers and menus.

Check

Desaturate a screenshot and count the borders. Each one should be doing something spacing or shade could not. Layers must still read as layers with all borders hidden.

07

One accent, used sparingly

A single accent hue marks the primary action, the active item and focus; status colours mean status and nothing else.

Why

Von Restorff effect: the one item that differs is the one noticed and remembered. An accent used everywhere signals nothing. Separating accent from green, amber and red keeps "here" distinct from "ok", "warning", "error".
Source: https://lawsofux.com/von-restorff-effect/

Do

  • Accent only on: the primary button, the active nav or tab, the focus ring, a selected row.
  • Green, amber, red, blue only for semantic state; pair them with an icon or text.
  • Keep counts, badges and chips neutral unless they carry state.

Don't

  • Colour every nav item or badge with the accent.
  • Pick an accent that resembles one of the status colours.
  • Use colour as the only carrier of meaning.

In tsumikit

  • --accent, --accent-dim, --text-on-accent for the single accent; themes keep the accent distinct from the status hues.
  • Status tokens --ok, --warn, --danger, --info; Badge, Dot, Callout take a tone and always pair colour with an icon or label.
  • canonicalTone() normalises tone names so there is one vocabulary.
  • Lint rule no-raw-color keeps app styles on these tokens.

Check

List every element using the accent colour. Each must be one of: primary action, active item, focus, selection. Then check every green, amber or red element has a non-colour cue beside it.

08

A spacing scale, and more room than feels right

All spacing comes from a fixed scale; start with too much whitespace, then remove some.

Why

Refactoring UI: cramped layouts feel cheap even when every pixel is correct, and arbitrary gaps make a page look accidental. A scale (4, 8, 12, 16, 24, 32, 48, 64) with no in-between values keeps rhythm consistent without thought.
Source: https://www.refactoringui.com/

Do

  • Use scale steps for padding, gaps and margins; jump a step rather than nudging by 2px.
  • Give cards and sections generous inner padding (16 or 24), and larger gaps between sections than inside them.
  • Align every element to an edge, grid or baseline that other elements also use.

Don't

  • Use 10px, 14px, 18px or other off-scale values.
  • Use the same gap everywhere; it flattens grouping (see "Group with space").
  • Reach for margin-top: 3px to fix alignment; fix the line height or the scale step.

In tsumikit

  • Spacing tokens --sp-1 (4px) through --sp-12 (48px), with --sp-0-5 (2px) for hairline adjustments only. --sp-1-5 (6px) and --sp-5 (20px) are deprecated: they still resolve, but sit off the scale.
  • Layouts Stack, Cluster, AutoGrid, Container take gaps from the scale; --content-max caps reading width.
  • Lint rule spacing-scale flags raw pixel spacing in app styles.

Check

Inspect padding and gap values on the screen; every one must be a scale step. Then double the main gaps in dev tools; if it looks better, the original was too tight.

09

Group with space, not boxes

Related items sit closer together or on a shared background; unrelated items are separated by more space, not by borders.
Do
Billing Visa ending 4242 Next charge 1 June
Team 4 members
Within a group --sp-1, between groups --sp-6: the gap does the grouping.
Don't
Visa ending 4242
Next charge 1 June
4 members
Every line in its own box; the eye reads borders instead of content.

Why

Gestalt laws of proximity and common region: things close together, or inside one region, are read as a group. Space between groups must be clearly larger than space within them, or the grouping disappears.
Sources: https://lawsofux.com/law-of-proximity/ , https://lawsofux.com/law-of-common-region/

Do

  • Within a group: one small step (4 or 8). Between groups: at least two steps larger (24 or 32).
  • Use a shared background tint to group without a border.
  • Put a label or heading closer to the content it describes than to the content above it.

Don't

  • Space twelve items evenly and expect the reader to find the four groups.
  • Draw a border around each group when a gap would do.
  • Let a section heading float equidistant between two sections.

In tsumikit

  • Stack with a per-group gap and a larger gap between stacks; Cluster for inline groups.
  • Card and Fieldset for common region; Divider only when space cannot separate.
  • SectionHeader attaches a heading to the block that follows.
  • Spacing tokens --sp-2, --sp-6, --sp-8 give the within / between contrast.

Check

Blur a screenshot until text is unreadable. The groups you intended must still be visible as clusters. If you see one even grid, the gaps are too uniform.

10

A real typeface, a fixed scale

Bundle a typeface designed for screens and use a fixed type scale with few weights.

Why

Practical Typography and Refactoring UI: typography carries most of an interface. System font fallback changes the design per machine; a flat scale (heading same size as body) removes hierarchy. A typeface such as Inter, Geist or IBM Plex Sans is built for UI sizes.
Sources: https://practicaltypography.com/summary-of-key-rules.html , https://www.refactoringui.com/

Do

  • Bundle the font files with the app; do not depend on the user having the face installed.
  • Use the kit's type scale and at most two body weights plus one bold for titles.
  • Tighten letter-spacing slightly on large headings; never on body text.
  • Use real typographic characters: an ellipsis, en dash, multiplication sign, curly quotes.

Don't

  • Set font-family: system-ui and hope.
  • Introduce ad-hoc font sizes outside the scale.
  • Use more than three weights on a page.

In tsumikit

  • Inter bundled via styles/font.css; --font-sans is the default stack, --font-mono for code.
  • Type scale --fs-xs (12), --fs-sm (13), --fs-base (15), --fs-lg (18), --fs-xl (22), --fs-2xl (28), scaled by --fs-scale (see FontScalePicker) and rounded to whole pixels; --fs-2xs, --fs-md and --fs-3xl are deprecated aliases of xs, base and 2xl.
  • Weights --fw-normal (400) and --fw-semibold (600) for body and controls, --fw-bold (700) for titles; --fw-medium is deprecated and resolves to 600; line heights --lh-heading, --lh-normal.
  • Heading and Text cover titles, body, labels, captions and eyebrows.
  • Lint rule no-raw-font flags font-family or font-size literals in app styles.

Check

Open dev tools on headings and body and list the font sizes in use. They must all be scale steps and the rendered family must be the bundled one, not a fallback. Count the weights: three at most.

11

Monospace only for code

Use a monospace face only for things that are literally code-like: paths, hashes, identifiers, commands.
Do
Deployed from commit a11af43 Build finished in 42 s
Mono marks the code-like value only. Lint rule no-raw-font checks font-family use.
Don't
Deployed from commit a11af43 Build finished in 42 s
A sentence set in monospace reads slowly and looks like a terminal.

Why

Practical Typography: monospace is slower to read and takes more width per character. Set as prose or labels it makes an interface feel like a terminal and wastes space; set on genuine code it signals "copy this exactly".
Source: https://practicaltypography.com/summary-of-key-rules.html

Do

  • Mono for file paths, commit hashes, IDs, shell commands and code blocks.
  • Sans for labels, nav, buttons, descriptions, timestamps and numbers in running text.
  • Tabular numerals (font-variant-numeric: tabular-nums) in tables and stats so columns line up without going mono.

Don't

  • Set a whole sidebar or label system in mono.
  • Use mono for numbers only to align them.
  • Mix two mono faces.

In tsumikit

  • --font-mono is only applied in code slots; --font-numeric and --font-label default to sans and can be switched to mono per app.
  • Text variant="code", CodeBlock, Kbd, WorkingDir, GitRef are the mono components.
  • Prose and renderMarkdown() set inline code in mono and prose in sans.

Check

Select all monospace text on the screen. For each run ask: would a user copy this character by character? If not, it should be sans.

12

Keep lines between 45 and 75 characters

Body text runs 45 to 75 characters per line so the eye finds the next line without effort.

Why

Practical Typography: lines shorter than about 45 characters break the rhythm; longer than about 75, the eye loses its place on the return sweep. Line length matters more than font size for reading comfort.
Source: https://practicaltypography.com/summary-of-key-rules.html

Do

  • Cap reading columns with a max width in ch or rem, independent of the viewport.
  • Raise line height slightly as lines get longer.
  • On wide screens, add columns or margins rather than stretching the text.

Don't

  • Let descriptions, prose or form help text run the full width of a 1600px window.
  • Shrink the font to make long lines fit.

In tsumikit

  • --measure sets the default reading width; --content-max caps page content.
  • Prose and EmptyState descriptions are measure-limited; Container constrains layouts.
  • Line-height tokens --lh-normal, --lh-snug.

Check

Count characters on a full line of body text at the widest supported viewport. Between 45 and 75.

13

Let imagery set the mood, keep the chrome quiet

Content imagery carries atmosphere; UI chrome stays neutral, text over images sits on a scrim, and a missing image gets a designed placeholder.

Why

Aesthetic-usability effect: interfaces perceived as beautiful are perceived as easier to use and are forgiven more. A backdrop fading into the page does more than any amount of styled chrome. An empty grey box where an image should be breaks the spell instantly.
Sources: https://lawsofux.com/aesthetic-usability-effect/ , https://www.refactoringui.com/

Do

  • Lead detail pages with a backdrop or hero image that fades into the page background.
  • Place text over images only on a gradient scrim that guarantees contrast.
  • Generate a placeholder from the item itself (initials, a hue derived from its name) when the image is missing or still loading.
  • Give every meaningful image alt text; decorative images get an empty alt.

Don't

  • Compete with the image using coloured chrome or heavy borders.
  • Render white text directly on an unpredictable photo.
  • Show an empty or broken-image box, even briefly.

In tsumikit

  • Backdrop layout for the hero-with-fade; Scrim for readable text over images.
  • Artwork shows a designed placeholder while loading or missing, via artworkGradient(), artworkHue() and initials(); Avatar does the same for people.
  • Skeleton for placeholders that are shapes rather than pictures.
  • Lint rule img-alt requires alt text on images.

Check

Load the page with images blocked. Every image slot must still show an intentional placeholder. Then re-enable images and verify text over them passes 4.5:1 at its lightest point.

14

Feedback is instant and calm

Respond at once, show a spinner only after a short delay and keep it long enough not to flicker, and update optimistically when success is likely.
Do
Default loadingDelay 200 ms and loadingMin 500 ms: a quick save stays calm.
Don't
loadingDelay=0 and loadingMin=0 flash a spinner for a few frames.

Why

Doherty threshold: under about 400 ms people stay in flow. A spinner that flashes for 50 ms makes a fast response feel broken; one that never appears makes a slow response feel dead. Optimistic updates keep the interface at the user's pace, with rollback as the safety net.
Sources: https://lawsofux.com/doherty-threshold/ , https://vercel.com/design/guidelines

Do

  • Wait about 200 ms before showing a loading indicator, then keep it for at least 500 ms.
  • Apply likely-to-succeed changes immediately and roll back with a message on failure.
  • Keep layout stable while loading: reserve space with skeletons, never shift content.
  • Prefer in-place indicators over page-level overlays.

Don't

  • Show a spinner on every click regardless of duration.
  • Block the whole page for a single row's update.
  • Animate the loading state so much that it draws more attention than the content.

In tsumikit

  • pending() helper and Button loadingDelay / loadingMin implement the 200 ms / 500 ms rule; loading="done" shows the confirmation tick.
  • Skeleton, Spinner, Progress, LoadMore for in-place loading.
  • toasts.error() with an action for rollback messages; toasts.undo() for reversible changes.
  • Motion tokens --dur-fast, --dur-base, --ease-out keep transitions short.

Check

Throttle to a fast connection: no spinner should be visible at all. Throttle to slow 3G: a spinner appears once, stays at least half a second, and nothing on the page shifts when the data lands.

15

Prefer undo over confirmation

Make actions reversible and offer an undo instead of asking "Are you sure?" beforehand.
Do
Invoice March
Offer letter
Travel receipts
toasts.undo() applies at once and commits when the toast leaves; Undo reverts.
Don't

Archive this message?

You can find it later in the archive.
A confirmation for a reversible action interrupts and gets clicked through.

Why

Nielsen heuristic 3, user control and freedom: people need a clearly marked emergency exit. Confirmation dialogs are read once and then clicked through by habit, so they stop protecting anyone; undo protects every time.
Sources: https://www.nngroup.com/articles/ten-usability-heuristics/ , https://vercel.com/design/guidelines

Do

  • Perform the action, then show "Moved to trash. Undo" for a few seconds.
  • Keep a confirm dialog only for truly irreversible or expensive actions (delete an account, send to many people), and name the consequence in the button ("Delete 12 files").
  • Make Escape, Back and Cancel always available and always do what they say.

Don't

  • Ask "Are you sure?" with generic OK / Cancel buttons.
  • Trap the user in a flow with no way out.
  • Make Undo appear only in a hidden menu.

In tsumikit

  • toasts.undo() for the reversible pattern; Toaster renders the action and keeps it keyboard-reachable.
  • ConfirmModal for the remaining irreversible cases, with a labelled destructive Button variant="danger".
  • SwipeRow exposes undoable row actions on touch.

Check

Perform each destructive action on the screen. Either an undo appears for it, or a confirm names exactly what will be lost. "Are you sure?" with OK / Cancel is a failure.

16

Empty states are design too

An empty list explains what belongs there and offers the action that fills it.
Do

No projects yet

Projects group your tasks and files. Create the first one to get started.

EmptyState says what belongs here and offers the action that fills it.
Don't
No data.
A bare line leaves people wondering whether something broke.

Why

Nielsen heuristic 6, recognition over recall, and heuristic 10, help where it is needed: the first screen a new user sees is usually empty, and a blank area makes them guess whether something is broken or missing. The empty state is the onboarding.
Source: https://www.nngroup.com/articles/ten-usability-heuristics/

Do

  • Say what goes here in one sentence, in the user's words.
  • Offer the one action that fills it as the primary button.
  • Distinguish "nothing yet", "nothing matches your filter" and "failed to load"; each gets its own copy and action.
  • Keep the layout stable: the empty state occupies the same region the content will.

Don't

  • Render an empty table header with no rows and no message.
  • Show "No data" with no action.
  • Use the same empty state for a filtered-to-nothing result as for a fresh account.

In tsumikit

  • EmptyState with title, description, actionLabel and onAction (or an action snippet for several).
  • Icon for the illustration slot; Callout for the failed-to-load variant with a retry action.
  • FilterInput and FilterSearchBar give a "clear filters" path for the filtered-empty case.

Check

Reach every list and table on the screen in three states: new account, filter with no match, load failure. Each must show a message and an action that makes sense for that state.

17

Errors say what happened and what to do next

An error message names the problem in plain language, states the cause if known, and offers the next step.
Do

We couldn't load your projects

The connection dropped before the list arrived. Your work is safe.

What happened, why it matters, what to do next; tone danger and a retry action.
Don't
Error 500: Internal Server Error
A status code is for the log, not the person.

Why

Nielsen heuristic 9: help users recognise, diagnose and recover from errors. "Request failed with status code 500" tells the user nothing they can act on; "Couldn't reach the indexer. It timed out after 30 s. Check that it's running, then retry." tells them everything.
Source: https://www.nngroup.com/articles/ten-usability-heuristics/

Do

  • Lead with what the user wanted and could not get ("Couldn't save the profile").
  • Add the cause in one short clause when you know it.
  • Offer a concrete recovery: retry, edit the field, open settings.
  • Place field errors next to the field and mark the field itself.

Don't

  • Surface raw exception text, status codes or stack traces.
  • Blame the user ("Invalid input").
  • Show the error in a place the user is no longer looking at.

In tsumikit

  • Callout tone="error" for inline errors with an action; toasts.error() with an action for transient ones (assertive live region).
  • Field shows a field-level error next to its control and links it with aria-describedby.
  • Status colour --danger always paired with the error icon and text.

Check

Trigger each failure path on the screen (offline, bad input, server error). Every message must be understandable by someone who does not know what HTTP is, and must contain a next step.

18

Speak the user's language

Words, icons and order follow the user's world, not the system's internals.

Why

Nielsen heuristic 2: match between the system and the real world. Users should not have to translate "entity", "node" or "sync job" into the things they actually own. Natural ordering (recent first, alphabetical) and familiar formats (relative time, local units) reduce effort.
Source: https://www.nngroup.com/articles/ten-usability-heuristics/

Do

  • Name things what users call them (a "film", not a "media item"; "folder", not "root path").
  • Format dates and durations the way people say them ("2 hours ago", "1 h 42 min").
  • Order lists the way users scan them, and say what the order is.
  • Use icons whose meaning is already established; add a label where it is not.

Don't

  • Expose database field names, enum values or internal IDs as labels.
  • Show ISO timestamps where a relative time would do.
  • Invent a new icon for a familiar action.

In tsumikit

  • Timestamp, relativeTime() and formatTimestamp() for human time; TimeDisplay, formatMediaTime() for durations.
  • formatCount() for counts with sensible rounding; Truncate keeps long paths readable.
  • Icon ships a conventional icon set; Tooltip adds a label where meaning is not obvious.

Check

Read every label and message aloud as if to a friend who does not know the codebase. Any word you would have to explain is a label to change.

19

Consistency beats local cleverness

The same thing looks and behaves the same everywhere, and works the way users expect from the apps they already use.

Why

Nielsen heuristic 4 and Jakob's law: users spend most of their time in other applications and bring those expectations with them. Every local deviation is something to learn, and every inconsistency is a moment of doubt.
Sources: https://www.nngroup.com/articles/ten-usability-heuristics/ , https://lawsofux.com/jakobs-law/

Do

  • Reuse the kit component for a job rather than restyling a near copy.
  • Keep one vocabulary: the same action has the same label and icon on every screen.
  • Follow platform conventions for selection, navigation, keyboard shortcuts and dialogs.
  • Put the same things in the same place on every page.

Don't

  • Build a one-off button, input or table because the kit's was "almost right".
  • Use "Remove" here and "Delete" there for the same action.
  • Change the primary button's position between pages.

In tsumikit

  • Atoms are the only place raw controls live; molecules compose them. Lint rule no-raw-control flags raw button, input and select in app code.
  • Theme and look tokens (--r-control, --control-height, --btn-fill) make every control share shape and size.
  • canonicalTone() and the Tone vocabulary unify status naming across components.
  • Lint rule breakpoints keeps media queries on the shared 40rem / 48rem / 64rem steps.

Check

Take screenshots of the same component type across three pages and lay them side by side. They must be indistinguishable in shape, size and behaviour.

20

Prevent errors before reporting them

Design so the mistake cannot happen: constrain input, show consequences before commit, and make the safe path the default.

Why

Nielsen heuristic 5: a careful design that prevents a problem is better than a good error message. Slips (wrong button) and mistakes (wrong mental model) have different cures: constraints and defaults for slips, previews and plain language for mistakes.
Source: https://www.nngroup.com/articles/ten-usability-heuristics/

Do

  • Use the control that only allows valid values: a select, a slider, a date picker, a segmented choice.
  • Validate as the user leaves a field, not after they submit the form.
  • Separate destructive actions from frequent ones in space and style.
  • Default to the safe choice; show the effect of a setting next to it.

Don't

  • Accept free text where the set of valid answers is known.
  • Place "Delete" next to "Save" in the same style.
  • Validate everything only on submit and then scroll the user to the top.

In tsumikit

  • Select, RichSelect, Combobox, Slider, SegmentedControl, RadioGroup, Switch constrain input.
  • Field attaches help text and inline validation; Fieldset groups related choices.
  • Button variant="danger" plus distance in a Toolbar keeps destructive actions apart; ConfirmModal for the truly irreversible.

Check

For each input on the screen, try to enter something invalid. The control should refuse or flag it before submit. For each destructive action, check it cannot be hit by a slip from a neighbouring frequent action.

21

Recognition over recall

Show options, state and context on screen instead of making people remember them.

Why

Nielsen heuristic 6 and Miller's law: working memory is small. Visible choices, remembered recent inputs and persistent context (where am I, what is selected) reduce the load; anything a user must remember from a previous screen is a defect.
Sources: https://www.nngroup.com/articles/ten-usability-heuristics/ , https://lawsofux.com/millers-law/

Do

  • Show where the user is: breadcrumbs, active nav, page title.
  • Offer suggestions and recent values in inputs instead of requiring exact syntax.
  • Keep the selection visible while acting on it (toolbar shows "3 selected").
  • Reveal keyboard shortcuts next to the actions they trigger.

Don't

  • Require typed identifiers the user saw on another page.
  • Hide the current filter behind a closed panel with no summary.
  • Show a modal that covers the data it asks about.

In tsumikit

  • Breadcrumb, NavBar, TabBar and Tabs show current location; SectionHeader names the block.
  • Combobox, FilterInput and suggest() surface valid values while typing.
  • Kbd and Tooltip show shortcuts in place; Popover and Drawer reveal detail without hiding context.

Check

Open any page cold. Can you tell where you are, what is selected and what filters apply without clicking anything? Then try each input without reading docs: valid values must be discoverable from the control itself.

22

Shortcuts for the experienced, defaults for the rest

Frequent actions get accelerators (keyboard, bulk, saved filters) that newcomers can ignore.

Why

Nielsen heuristic 7, flexibility and efficiency of use: the same interface serves first-time and expert users. Experts want fewer steps; novices want fewer choices. Shortcuts layered on top of a simple default serve both.
Source: https://www.nngroup.com/articles/ten-usability-heuristics/

Do

  • Add keyboard shortcuts for the top actions and show them in tooltips and menus.
  • Allow bulk selection and bulk actions on lists.
  • Let filters, sort and views be saved or shared via the URL.
  • Support paste, drag and drop and type-ahead wherever they make sense.

Don't

  • Make shortcuts the only way to do something.
  • Override browser or OS shortcuts.
  • Hide bulk actions until a user discovers multi-select by accident.

In tsumikit

  • Kbd to display shortcuts; Menu items show them inline; Tooltip for hover hints.
  • FilterInput with the filters query grammar for saved, shareable filters; urlState() keeps them in the URL.
  • Dropzone, FileButton and Composer for drag, drop and paste; SortableList for keyboard-reorderable lists.

Check

Do the three most frequent tasks on the screen without a mouse. Each should take fewer keystrokes than clicks. The shortcuts must be visible somewhere on the screen.

23

The URL is state

Filters, tabs, sort and pagination live in the URL so they survive refresh, Back and sharing.
Do
All Open Done
Tabs with href from urlState('view'): refresh, Back and middle-click all work. Watch the address bar.
Don't
Component state only; a refresh forgets the selection.

Why

Vercel and Rauno Freiberg interface guidelines: a view a user cannot link to or return to is lost work. Back must restore both the view and its scroll position; a pasted link must open the same thing the sender saw.
Sources: https://vercel.com/design/guidelines , https://interfaces.rauno.me/

Do

  • Encode the active tab, filter query, sort column and page in the query string or path.
  • Restore scroll position on Back and Forward.
  • Make the active state of tabs and segments come from the URL, not from component memory.
  • Use replaceState for typed-ahead changes and pushState for navigational ones.

Don't

  • Keep tab or filter state only in a store that resets on refresh.
  • Reset to page 1 and clear filters when the user presses Back.
  • Encode state that is not shareable (a hover, an open menu).

In tsumikit

  • urlState() binds a value to a query parameter.
  • Tabs, SegmentedControl and Pagination accept href per item so the active state is a real link.
  • FilterInput with serialize() and parse() round-trips filter queries through the URL.

Check

Set a filter, switch a tab, go to page 3, then refresh and press Back twice. Every step must restore exactly what was on screen, and the URL at each step must open the same view in a new window.

24

Links are links, buttons are buttons

Navigation uses an anchor so middle-click, Cmd-click and "open in new tab" work; actions use a button.
Do
Open the AppShell example
A navigation is an anchor: hover shows the URL, middle-click opens a tab.
Don't
A button that navigates in onclick breaks middle-click and the status bar.

Why

Vercel and Rauno Freiberg interface guidelines, and Nielsen heuristic 4: users expect anything that navigates to behave like a link. A div with an onclick breaks the context menu, accessibility and the ability to open several things at once.
Sources: https://vercel.com/design/guidelines , https://interfaces.rauno.me/

Do

  • <a href> for anything that changes the URL; <button> for anything that does not.
  • Style a link as a button when needed, but keep the anchor element.
  • Make whole cards clickable with a single anchor, not a click handler on the container.
  • Mark external links and give them accessible names.

Don't

  • Attach onclick navigation to a div, span or card.
  • Use a button for "View details" that only navigates.
  • Nest interactive elements inside the link.

In tsumikit

  • Link for text links and button-styled links; Card renders an anchor when given href.
  • NavItem, TabBar, Breadcrumb, Pagination, Tabs, SegmentedControl take href and render real anchors.
  • AnchorAttributes type carries the anchor props through.

Check

Middle-click every navigational element on the screen. Each must open in a new tab. Right-click them: "Copy link address" must be present.

25

Every control shows a visible focus ring

Keyboard focus is always visible, on every interactive element, with a ring that contrasts with its surroundings.

Why

WCAG 2.2 (2.4.7 focus visible, 2.4.11 focus not obscured) and the Vercel interface guidelines: keyboard users navigate by watching focus. Removing the outline without a replacement strands them. :focus-visible shows the ring only for keyboard focus, so pointer users are not bothered.
Sources: https://www.w3.org/WAI/WCAG22/quickref/ , https://vercel.com/design/guidelines

Do

  • Use :focus-visible with an accent ring at least 2px wide and an offset.
  • Keep focus order the same as visual order.
  • Move focus into dialogs on open and back to the trigger on close.
  • Make the ring visible on dark and light surfaces and inside scroll containers.

Don't

  • Write outline: none without a replacement.
  • Rely on a colour change alone to show focus.
  • Let focus disappear behind a sticky header or an overlay.

In tsumikit

  • --focus-ring, --focus-ring-width, --focus-ring-offset, --focus-ring-offset-inset tokens; every atom applies them under :focus-visible.
  • Modal, Drawer, Menu, Popover manage focus trapping and return.
  • Roving focus for Toolbar, RadioGroup, Tabs, Menu.
  • Dev-audit warnings flag unlabelled controls (warnUnlabelled()).

Check

Tab through the entire screen from the address bar. At every stop you must see where focus is, in the order you expected, and nothing must be skipped or trapped.

26

Generous targets

Interactive elements are at least 24px with a pointer and 44px on touch, with no dead zones between them.

Why

Fitts's law: time to hit a target depends on its size and distance; frequent targets should be big and close. WCAG 2.2 (2.5.8) sets the 24px minimum, mobile platform guidance sets 44px. Gaps between adjacent targets prevent mis-taps.
Sources: https://lawsofux.com/fittss-law/ , https://www.w3.org/WAI/WCAG22/quickref/

Do

  • Make the whole row or card the target, not just the text inside it.
  • Pad icon buttons to the touch size even when the icon is small.
  • Put frequent actions near where the pointer or thumb already is.
  • Leave at least 8px between adjacent targets.

Don't

  • Ship 16px icon buttons with no padding.
  • Make the hit area smaller than the visible shape.
  • Place a destructive action within thumb reach of a frequent one on mobile.

In tsumikit

  • --touch-target (44px) and --touch-target-compact (40px, 44px on coarse pointers); on coarse pointers md controls and boxes are 44px; --control-height variants for desktop density.
  • --hit-target (24px, --touch-target on coarse pointers) and --hit-slab: small controls (inline IconButton, link Button, bare Popover/Menu triggers, Badge action, Switch, Toggle, Checkbox) grow an invisible slab up to it without moving layout; hitArea="compact" opts out.
  • IconButton and Button pad to the target size; TabBar and SwipeRow are built for thumbs.
  • AppShell places primary navigation at the bottom on narrow screens.

Check

Overlay 44px squares on a phone screenshot and 24px on a desktop one. Every interactive element must contain one. Tap between two neighbouring targets: one of them must respond, never neither.

27

Cheap motion, respected preferences

Animate only transform and opacity, keep durations short, and honour reduced-motion, zoom and paste.

Why

Vercel and Rauno Freiberg interface guidelines: transform and opacity run on the compositor; animating layout properties janks. transition: all animates things you did not intend. Users who set reduced motion, zoom text or paste passwords are telling you something; blocking them is hostile.
Sources: https://vercel.com/design/guidelines , https://interfaces.rauno.me/ , https://www.w3.org/WAI/WCAG22/quickref/

Do

  • Transition transform and opacity; keep enter around 180 ms and exit shorter.
  • Wrap decorative motion in prefers-reduced-motion: no-preference, or reduce to a fade.
  • Allow pinch and text zoom; never set user-scalable=no.
  • Allow paste in every input, including password and code fields.

Don't

  • Write transition: all.
  • Animate height, width, top or margin.
  • Run looping animations the user cannot stop.
  • Disable autocomplete or paste "for security".

In tsumikit

  • Duration tokens --dur-fast, --dur-base, --dur-slow, --dur-exit; easing --ease-out, --ease-spring; press and shift scales --press-scale, --shift-sm.
  • The reset collapses motion under prefers-reduced-motion: reduce; MotionSettings lets users choose in-app.
  • Lint rule motion flags transition: all and layout-property animations.

Check

Enable "reduce motion" in the OS and reload: nothing should move except opacity. Record a performance profile while opening a menu: no layout thrash. Zoom to 200%: everything still usable.

28

Less, but better

Every element earns its place; if removing it loses nothing, remove it.

Why

Dieter Rams's tenth principle, "good design is as little design as possible", and Nielsen heuristic 8, aesthetic and minimalist design: every extra element competes with the ones that matter. Restraint is what makes the remaining elements legible.
Sources: https://www.vitsoe.com/us/about/good-design , https://www.nngroup.com/articles/ten-usability-heuristics/

Do

  • Remove decoration that carries no information: borders, icons next to every label, redundant titles.
  • Say things once; a page title does not need to be repeated in a breadcrumb and a heading.
  • Prefer the plain version of a component until the richer one is justified.
  • Review each screen by deleting elements one at a time and asking what was lost.

Don't

  • Add an icon to every button and a badge to every row.
  • Show every field the backend has.
  • Keep a feature on screen because it was expensive to build.

In tsumikit

  • Components default to the quiet form (Button variant="default", Card without border, Text body) and take opt-in props for emphasis.
  • Looks and micro-interactions are opt-in via parseLook() and LookPicker, not applied by default.
  • Dev-audit warnings surface redundancy such as duplicate primaries and unlabelled controls.

Check

For each element on the screen, hide it in dev tools. If the screen still answers "what is this, what state is it in, what can I do", the element was decoration.

29

Colour is never the only cue

State conveyed by colour is also conveyed by an icon, a label or a shape.
Do
Paid Pending Overdue
Colour plus a word: the state survives greyscale and colour blindness.
Don't
A coloured disc alone carries the whole meaning.

Why

WCAG 1.4.1 (use of colour): about one in twelve men cannot reliably distinguish red from green. A dot that is green or red is a dot. Pairing colour with text or an icon also helps everyone in bad light or on a poor display.
Source: https://www.w3.org/WAI/WCAG22/quickref/

Do

  • Pair every status colour with a word or an icon ("Failed", a cross).
  • Use shape or position as well as colour in charts and legends.
  • Underline or otherwise mark links in running text.
  • Test with a colour-blind-safe theme or a simulator.

Don't

  • Show a bare coloured dot as the only indicator of health.
  • Distinguish chart series by hue alone.
  • Mark required fields by colour only.

In tsumikit

  • Badge, Dot, Callout, Gauge, Meter take a tone and render an icon or label alongside the colour.
  • CapBar and SegmentedProgress carry a legend; Swatch labels colours.
  • A verified colour-blind-safe theme (Okabe-Ito) is available through ThemePicker.

Check

Switch to the colour-blind-safe theme or apply a greyscale filter to a screenshot. Every state that was visible before must still be identifiable.

30

Help where it is needed

Explanation appears next to the thing it explains, at the moment it is needed, and is short.

Why

Nielsen heuristic 10: the best interface needs no documentation, but when help is needed it should be in context, searchable, focused on the task and concise. A manual nobody opens is not help.
Source: https://www.nngroup.com/articles/ten-usability-heuristics/

Do

  • Put one line of help text under the field it concerns.
  • Use tooltips for icon-only controls and for the meaning of a term.
  • Explain a setting's effect next to the setting, in the user's words.
  • Link to deeper documentation from the place where the question arises.

Don't

  • Replace clear labels with a help icon.
  • Write paragraphs where a sentence will do.
  • Hide the only explanation in a separate help section.

In tsumikit

  • Field renders help and error text under its control and links it with aria-describedby.
  • Tooltip for terse in-place help; Popover and Disclosure for a little more.
  • Callout tone="info" for a short contextual note; Prose for longer documentation rendered from markdown.

Check

Find every setting, field and icon-only control on the screen. For each, can a new user learn what it does without leaving the screen? If not, add one line of help there.