Skip to content

Inline message

An inline message tells you about a condition of the page in front of you, such as an inbox that needs reconnecting or a candidate list that only partly loaded. It sits at the top of what it concerns and stays until the condition is resolved.

Example

This inbox was signed out. Reconnect it to keep receiving mail.

  • Marko BabićContract for the welding team9:42
  • Ivana KovačOffer for the Rijeka shipyard8:30
  • Luka PerićInterview notes from Split8:02
  • Petra NovakHousing for the new team7:48

Send offer

The work permit of Priya Sharma ends before this start date.

When to use it

Use an inline message for a condition that belongs to one page or panel and lasts while you work: the connection is down, an inbox needs reconnecting, a job is read only for you, some candidates did not load.

The result of something you just did is a toast. A problem with one field is an error under that field. A question that must be answered before anything happens is a dialog.

Anatomy

One sentence that says what is true and what you can do, then at most one action at its end. The sentence wraps and is never cut off.

The band runs flush across the top of a list or a column. The box sits inside content, such as the top of a dialog or a form.

This job is read only for you. Ask Ana Horvat, who owns it, for edit access.

Band height
36 px, 44 px on touch
Band side padding
12 px, 16 px on a phone or touch
--space-3
Box corner radius
8 px
--radius-lg
Box padding
8 px by 12 px
Sentence
Regular weight, on as many lines as it needs
Gap before the action
8 px
--space-2
Action
Small secondary button, 36 px
Close, neutral only
Quiet icon button, 32 px

Tones

Neutral states a fact. Warning says something will go wrong unless someone acts. Error says work cannot go on until someone acts.

Neutral

You are offline. Changes will save when the connection is back.

Fill
The second surface
--surface-2
Text
Ink at 85 percent
--text

Warning

Some candidates did not load.

Fill
Warning at 10 percent
--warning
Text
Warning ink
--warning-ink

Error

This inbox was signed out. Reconnect it to keep receiving mail.

Fill
Error at 10 percent
--error
Text
Error ink
--error-ink

Behavior

A page or a panel shows one inline message at a time. When two conditions hold, the more severe one shows: error first, then warning, then neutral.

Warning and error messages have no close button. They leave when the condition is resolved and return if it comes back. A neutral message can be closed when the same information is available elsewhere.

A message present when the page opens appears without motion, and one that arrives while you work fades in.

Content

Say what is true, then what to do, in words the reader uses: “The candidate list did not load. Try again.”

The button repeats the verb of the fix, such as Reconnect or Try again.

Accessibility

A message that appears after you act, such as a failed save, is announced once as an alert. A message present when the page loads is read in its place, without an announcement.

The sentence names the problem, so color is not the only signal.

After a form fails to submit, focus moves to the first field with an error, and the message at the top of the form is announced.

Permitted and not permitted

Permitted

  • You are offline. Changes will save when the connection is back.

    The condition, then what happens next.

Not permitted

  • Error: request failed (500)

    A code and no next step.

  • A close button on an error

    Closing it hides the message and leaves the problem.

  • A message floating over the content

    It covers your work. Push the content down.

NextNotifications

Inline message

States a lasting condition of one surface at the top of that surface, with the one action that resolves it.

  • Kind: component
  • Page: https://design.werklist.com/components/inline-message
  • Version: 2.1.2

When to use it

  • The connection is down (neutral)
  • An inbox needs reconnecting (error)
  • Part of a list did not load, such as some candidates (warning)
  • A job or a board is read only for this reader (neutral)
  • A form did not submit (error, at the top of the form)
  • A problem inside an open dialog, such as a work permit that ends before the start date of an offer (box, at the top of the dialog)

When not to use it

  • The result of the reader's own action: Toast
  • A single field value: the field error of Field
  • A decision before anything happens: Dialog
  • Something that happened elsewhere: Notifications

Rules

  • one inline message per surface; order of precedence error, warning, neutral
  • warning and error have no close button; they leave when the condition resolves
  • the message pushes content down and never overlays it

Anatomy

  • band: flush with its column, no corners, no line under it; 36 px high, 44 px on coarse pointers; side padding 12 px, 16 px on phones and coarse pointers (--space-3, --space-4)
  • box: corner radius 8 px; padding 8 px by 12 px (--radius-lg, --space-2, --space-3)
  • sentence: regular weight on a line of 1.375; wraps and is never cut off
  • gap between sentence and action: 8 px (--space-2)
  • action: at most one; a small secondary button (36 px, 44 px on coarse pointers) at the end of the first line (--surface-control)
  • close: neutral tone only, when the information is available elsewhere; a small quiet icon button named Dismiss

Variants

  • neutral: states a fact; fill --surface-2; ink --text at 85 percent
  • warning: something will go wrong unless someone acts; fill --warning at 10 percent opacity; ink --warning-ink, above 4.5:1 in both themes
  • error: work cannot go on until someone acts; fill --error at 10 percent; ink --error-ink, above 4.5:1 in both themes

Sizes

  • band: height 36 px, 44 px on coarse pointers, padding 0 12 px, 0 16 px on phones
  • box: padding 8 px 12 px

States

  • present at load: rendered in place, no motion, no announcement
  • raised while working: fades in (--duration-fast, --ease-standard)
  • resolved: removed; content moves up
  • action busy: the button shows its spinner and keeps its width
  • reduced motion: no fade
  • action focus: focus ring (--focus-ring, --focus-ring-width, --focus-ring-offset)

Keyboard

  • Tab: reaches the action, then the close button, in reading order before the content
  • Enter or Space: runs the action

Accessibility

  • error raised after the reader acts: role alert, heard once
  • warning or neutral raised while working: announced through the polite live region
  • present at load: read in place, no announcement
  • the sentence names the problem; color is not the only signal
  • after a failed submit, focus moves to the first field with an error, and the message at the top of the form is announced

Content

  • one sentence of what is true and what to do
  • the action repeats the verb of the fix (Reconnect, Try again, Request access)
  • never an error code as the message

Tokens

  • --surface-2
  • --error
  • --warning
  • --warning-ink
  • --error-ink
  • --text
  • --surface-1
  • --surface-control
  • --radius-lg
  • --space-2
  • --space-3
  • --space-4
  • --duration-fast
  • --ease-standard
  • --focus-ring
  • --focus-ring-width
  • --focus-ring-offset

JSON

{
  "title": "Inline message",
  "path": "/components/inline-message",
  "url": "https://design.werklist.com/components/inline-message",
  "text": "https://design.werklist.com/agent/components/inline-message",
  "summary": "A message at the top of a page, list or dialog about something that is true there now, with the action that fixes it.",
  "version": "2.1.2",
  "kind": "component",
  "name": "Inline message",
  "purpose": "States a lasting condition of one surface at the top of that surface, with the one action that resolves it.",
  "use": [
    "The connection is down (neutral)",
    "An inbox needs reconnecting (error)",
    "Part of a list did not load, such as some candidates (warning)",
    "A job or a board is read only for this reader (neutral)",
    "A form did not submit (error, at the top of the form)",
    "A problem inside an open dialog, such as a work permit that ends before the start date of an offer (box, at the top of the dialog)"
  ],
  "avoid": [
    "The result of the reader's own action: Toast",
    "A single field value: the field error of Field",
    "A decision before anything happens: Dialog",
    "Something that happened elsewhere: Notifications"
  ],
  "anatomy": [
    {
      "part": "band",
      "measure": "flush with its column, no corners, no line under it; 36 px high, 44 px on coarse pointers; side padding 12 px, 16 px on phones and coarse pointers",
      "token": "--space-3, --space-4"
    },
    {
      "part": "box",
      "measure": "corner radius 8 px; padding 8 px by 12 px",
      "token": "--radius-lg, --space-2, --space-3"
    },
    {
      "part": "sentence",
      "measure": "regular weight on a line of 1.375; wraps and is never cut off"
    },
    {
      "part": "gap between sentence and action",
      "measure": "8 px",
      "token": "--space-2"
    },
    {
      "part": "action",
      "measure": "at most one; a small secondary button (36 px, 44 px on coarse pointers) at the end of the first line",
      "token": "--surface-control"
    },
    {
      "part": "close",
      "measure": "neutral tone only, when the information is available elsewhere; a small quiet icon button named Dismiss"
    }
  ],
  "variants": [
    {
      "name": "neutral",
      "use": "states a fact; fill --surface-2; ink --text at 85 percent"
    },
    {
      "name": "warning",
      "use": "something will go wrong unless someone acts; fill --warning at 10 percent opacity; ink --warning-ink, above 4.5:1 in both themes"
    },
    {
      "name": "error",
      "use": "work cannot go on until someone acts; fill --error at 10 percent; ink --error-ink, above 4.5:1 in both themes"
    }
  ],
  "sizes": [
    {
      "name": "band",
      "height": "36 px, 44 px on coarse pointers",
      "padding": "0 12 px, 0 16 px on phones"
    },
    {
      "name": "box",
      "padding": "8 px 12 px"
    }
  ],
  "states": [
    {
      "name": "present at load",
      "change": "rendered in place, no motion, no announcement"
    },
    {
      "name": "raised while working",
      "change": "fades in",
      "tokens": [
        "--duration-fast",
        "--ease-standard"
      ]
    },
    {
      "name": "resolved",
      "change": "removed; content moves up"
    },
    {
      "name": "action busy",
      "change": "the button shows its spinner and keeps its width"
    },
    {
      "name": "reduced motion",
      "change": "no fade"
    },
    {
      "name": "action focus",
      "change": "focus ring",
      "tokens": [
        "--focus-ring",
        "--focus-ring-width",
        "--focus-ring-offset"
      ]
    }
  ],
  "keys": [
    {
      "key": "Tab",
      "action": "reaches the action, then the close button, in reading order before the content"
    },
    {
      "key": "Enter or Space",
      "action": "runs the action"
    }
  ],
  "accessibility": [
    "error raised after the reader acts: role alert, heard once",
    "warning or neutral raised while working: announced through the polite live region",
    "present at load: read in place, no announcement",
    "the sentence names the problem; color is not the only signal",
    "after a failed submit, focus moves to the first field with an error, and the message at the top of the form is announced"
  ],
  "content": [
    "one sentence of what is true and what to do",
    "the action repeats the verb of the fix (Reconnect, Try again, Request access)",
    "never an error code as the message"
  ],
  "tokens": [
    "--surface-2",
    "--error",
    "--warning",
    "--warning-ink",
    "--error-ink",
    "--text",
    "--surface-1",
    "--surface-control",
    "--radius-lg",
    "--space-2",
    "--space-3",
    "--space-4",
    "--duration-fast",
    "--ease-standard",
    "--focus-ring",
    "--focus-ring-width",
    "--focus-ring-offset"
  ],
  "rules": [
    "one inline message per surface; order of precedence error, warning, neutral",
    "warning and error have no close button; they leave when the condition resolves",
    "the message pushes content down and never overlays it"
  ]
}

Raw file: https://design.werklist.com/agent/components/inline-message