Writing
Voice, labels and capitalisation: the words on buttons, in dialogs and in messages, written the way a person would say them.
API Button ConfirmDialog Toaster LoadFailure LoadMoreFooter Switch Label Tabs Table Textarea InfoPopover FieldDescription Timestamp
Write what a person would say out loud: short, specific, in sentence case, and naming what happens.
Each Revoke… button names the action and ends in an ellipsis because it asks before it acts. The dialog's title is the question, its description says what stops working and that there is no way back, and the button that answers it repeats the verb. The toast afterwards says what happened, to what. Revoke all three for the empty state, which says what would be here and how it gets here.
Voice#
The people using these tools are in the middle of something else. Words that get out of their way read as plain, calm and exact.
- Plain. The everyday word over the technical one, unless the reader's own job uses the technical one: a CI tool says run and artifact, not execution and output object.
- Calm. No exclamation marks, no jokes in an error, no "Oops". A failure is reported, not performed.
- About the thing, not about the app. The app does not say I or we, and it does not thank the reader for waiting. "Conversation archived", not "We've successfully archived your conversation!".
- Never blaming. Say what is wrong with the input and how to fix it, not that the reader got it wrong: "Enter an email address, like alice@example.com.", not "You entered an invalid email".
- The same word for the same thing. If it is a conversation in the list, it is a conversation in the toast and the empty state, never a thread or an email.
Labels#
A label is the shortest phrase that says what a control does. Buttons and menu items start with a verb; the rest name the setting or the thing.
Answer a dialog with the verb its title asks about, and keep Cancel for the way out.
Answer with Yes, No or OK. The reader has to go back to the title to find out what they agreed to.
- Verb, then object on a button or menu item: "Save profile", "Mark as unread", "Copy link". Drop the object only when the surface already names it: a dialog titled "Revoke the token for ci-runner?" can end in "Revoke".
- An ellipsis (…) when the control asks for more before it acts: it opens a dialog, a picker or a form ("Revoke…", the theme menu's "Custom themes…"). Not on a control that just opens a view, and not on the confirming button inside the dialog.
- A toggle names its on state. A
SwitchorCheckboxsays what is true when it is on: "Wrap long lines", never "Don't wrap long lines". A negative label makes off a double negative. - An icon-only button still has a label, as its
aria-label, and shows it in a tooltip. See Accessibility.
Name what is true when the switch is on.
Name the off state, so that turning it on turns something off.
Explanations#
The screen already says most of what a sentence would: the label names the setting, the switch
shows its state, and a missing Save button says that changes apply at once. Write only what it
cannot show, and put that behind an InfoPopover.
Put what a setting does behind an (i) right after its label, where a mouse, a thumb and the keys all open it.
How files look while you edit them. Changes apply at once.
Tidies indentation and trailing spaces each time a file is saved.
Run a grey line under every label, or a subtitle that says what the controls already show. The reader learns to skip them, and skips the one that mattered.
| Words | Where |
|---|---|
| What a setting, an option or a section does, or why it is there | Behind an (i), when the label alone does not say it |
| What the screen already shows: the heading again, "Changes apply at once" over switches, "Saved when you press Save" beside a Save button | Nowhere |
| A limit the reader needs while typing: a format, a length | Under the field, as a FieldDescription |
| What is wrong with a field | Under the field, as a FieldError |
| Empty, failed, done | On screen, as the message (see Messages below) |
| What a confirmation's action does, and that it cannot be undone | In the dialog's description |
- One (i) per thing explained, right after its label or title, never at the far end of the row, where the row's own control sits.
- Name it when a view holds more than one:
label="About format on save", so a screen reader tells them apart. A lone one may keep its default, "More information". - A sentence or two. It may end in a link to where the subject is told in full; anything longer is a page of its own.
- Never the only copy of what the task needs. A required format, a consequence that cannot be undone: those stay on screen.
Capitalisation#
Sentence case everywhere: capitalise the first word and proper nouns, and nothing else. That includes titles, buttons, menu items, tabs and column headers — "Terminal theme", "Exit fullscreen", "Load more", as @orz/ui's own labels are written. Product and brand names keep their own spelling: GitHub, Storybook, npm.
This differs from both sources: Apple's HIG puts macOS buttons and menu items in title case, and GNOME's capitalises headers. One rule for every surface is easier to keep than a table of which surface gets which, and sentence case reads as speech, which title case does not.
| Text | Case | Ends with | Example |
|---|---|---|---|
| Title of a page, a dialog or an empty state | Sentence | Nothing, or ? when it asks | Revoke the token for ci-runner? |
| Button, menu item, tab | Sentence | Nothing, or … when it asks for more | Custom themes… |
| Field label, setting, column header | Sentence | Nothing; no colon | Terminal theme |
| Description, help, message of one sentence or more | Sentence | A full stop | A revoked token cannot be restored. |
| Toast | Sentence | Nothing | Conversation archived |
| Placeholder | Sentence | … when it asks to be typed into | Leave a comment in markdown… |
Some checks were not successful
Merging is blocked until every check passes.
| Check | Status | Duration |
|---|---|---|
| CI / Lint | Passed | 5s |
| CI / Build | Passed | 11s |
| CI / Test | Failed | 7s |
The pull request's tabs, the checks' title, its explanation and the table's column headers are
sentence case; only the explanation is a sentence, so only it ends in a full stop. Under
Conversation, the field's label has no colon and the placeholder ends in …, because it asks
to be typed into.
Messages#
Loading, empty, failed and done each look different and say so. A message says what happened and, when the reader can do something about it, what that is.
- Done: a toast in the past tense, naming the object: "Conversation archived", "3 conversations archived". No "successfully": a toast that appears has already said that.
- Loading: say what is loading when it takes more than a moment ("Loading conversations…"); a skeleton needs no words.
- Empty: say what would be here and how it gets here: "No access tokens. Scripts and bots that need one get it from the command line."
- Failed: what failed, in the reader's terms, then the way out.
LoadFailuretakes the message, the raw error as itsdetail(shown on hover, not in the sentence) and a Retry;RefreshFailureandLoadMoreFooterwrite their own sentence and keep the raw error out of it the same way. Never show a stack trace or an HTTP status as the message.
Spelling, numbers and symbols#
- One spelling per app. @orz/ui's own labels use British spelling ("Find a colour"); its code
uses American, as CSS does (
color). An app may pick either, and then holds to it. - Numerals for numbers, "3 conversations", not "three conversations", and the plural that
matches: "1 conversation", "2 conversations". Build the plural with
Intl.PluralRulesrather than writing "conversation(s)". - The right character, where it has a job:
…for an ellipsis,–for a range ("10–20"),×for dimensions ("44 × 44"),—between two halves of a sentence. - Dates and times with
TimestampandTimestampRange, in the reader's language and time zone; see below.
Dates and times#
- Started
- Logs kept until
- Checks refreshed
A run from the Pull request demo. When it started is a time to set beside its log, so it takes the date and the time; how long its logs are kept needs only the day. Press Refresh: the checks were refreshed "now", and the words keep up as the minutes pass.
Timestamp writes one instant, in the reader's language and time zone, and puts the whole of it,
to the second and with the zone, in its title.
datetime, the default, for when something happened: a comment's header, an event on a timeline, a task's Updated field.datewhere the day is all that counts: when someone joined, when a file went to the trash.timewhere the day is already written beside it: a chart's axis over the last day, the rows under a day's heading. The same day again on every row only makes the rows longer.relativewhere how fresh something is matters more than when: a list sorted by activity, the last refresh or sync. It keeps itself current while it is on screen, and past a week it writes the date.datetimeanddateleave the year out within the reader's current year and write it for any other, so this year's dates stay short and an old one cannot pass for this year's.- One kind of time takes one format on every screen of an app: a comment's time is not
datetimein the timeline andrelativein the inbox. - A relative time never stands alone where the exact time matters. Its
titleholds the time, and a title shows on hover, never under a finger.
TimestampRange writes a span from one instant to another, as datetime or date, and writes
what both ends share once: an hour on one day reads "Nov 27, 6:00 – 7:00 PM", where two
Timestamps with a dash between them write the day twice. It leaves the year out when both ends
are in the reader's current year. Its end is the instant the span stops, outside it, as a server
sends a chart's bucket: a week from Monday ends at the next Monday's midnight, and date writes
it as ending on Sunday. Pass the span as it came, whichever format writes it.
Do not format a date or a span by hand, with toLocaleString() or a format string of your own:
each one writes a different shape, in a different zone. A place that takes a string, such as a
chart's labels drawn in SVG or an aria-label, takes the same text from formatTimestamp and
formatTimestampRange.
On each platform#
The same words are read with a mouse and with a thumb, so they name what happens, not the gesture that makes it happen.
| Pointer | Touch | |
|---|---|---|
| Instructions | "Select a conversation", "Open the menu"; never "Click" | The same words; never "Tap" |
| Tooltips | Repeat a label or add a shortcut | Do not appear, so they never hold the only copy of anything |
| Shortcuts | May appear in a tooltip or menu item | Left out; there is no keyboard to press them on |
| Length | A label can be longer where the layout is wide | Write the label to fit a 390px screen first |
In the demos
- SettingsEach Switch names its on state (Wrap long lines), buttons are a verb and its object (Save profile), and a button that opens a dialog first ends in an ellipsis (Revoke…).
- Sign inEach error says how to put it right, Enter an email address, like alice@example.com. Buttons are a verb and its object, Send code or Save password, and a saved password is said in a toast, Password changed.
- MailToasts name the thing and what happened (“3 conversations archived”), each empty folder says what would be in it, and Delete forever… asks with the count.