Skip to content

Feedback

InlineMessage

Message next to the content it is about: success, warning, information or error.

  • Experimental
  • No keyboard interaction
  • Screen reader not tested yet

Updated 2026-11-12

Playground

Change the props. The controls come from the documented props.
Information:

Saved

Your changes are live.
tsx
<InlineMessage title="Saved">Your changes are live.</InlineMessage>

Usage

When to use

Use an inline message next to the content it is about: the confirmation after a form is sent, a warning above a field group, an error after an upload failed.

When not to use

  • For a state that affects the whole page: use Banner.
  • For the error of a single field: the field shows its own error.
  • For a short status in a table cell: use StatusDot or Pill.

How it works

Five tones: positive, caution, info, danger and neutral. Each has its own icon shape and tinted fill, and a visually hidden word (Success, Warning, Information, Error, Note) that screen readers hear first. Set announce for messages that appear after an action: danger is then announced as an alert, the other tones politely as a status.

Content guidelines

Say what happened and what to do next: “The file is larger than 10 MB. Choose a smaller file.” Use title for the short headline and the body for the detail. Danger means something failed or will be destroyed; for “please check this”, use caution.

Do and don’t

Do
  • Say what happened and what to do next.
  • Place it directly above or below the content it refers to.
Don’t
  • Don't use danger for warnings; danger means something failed or will be destroyed.
  • Don't use it for page-wide states; use Banner.

Anatomy

The parts of the component and what each one does, as in the playground above.
  1. containerTinted box with a 1px border in the tone colour.
  2. iconShape differs per tone, so colour is never the only signal.
  3. titleOptional, semibold.
  4. bodySmall text in text.primary.

Examples

Type-checked, and the same code goes into the AI manifest. Import: import { InlineMessage } from "@/ds";

Positive

Success:

Request sent

We reply within two working days.

Caution

Warning:
The budget is above the usual range for this kind of project.

Info

Information:
Drafts are kept for 30 days.

Danger

Error:

Upload failed

The file is larger than 10 MB. Choose a smaller file.

Neutral

Note:
Fields marked optional can be left empty.

Props

Checked against the component's TypeScript type on every build.
InlineMessage props
NameTypeDefaultDescription
tone"neutral" | "positive" | "caution" | "info" | "danger""info"Sets icon, tint and the word screen readers hear first.
titlestring–Short bold first line.
childrenReactNode–One or two sentences.
announcebooleanfalseAnnounce on appearance: danger as alert, other tones as status.

Tokens used

Derived from the utility classes in the component's source. Copy a class with one click.
Tokens used by InlineMessage
TokenTierValueUtility
input.radiuscomponent8px
border.hairlinesemanticrgba(10,10,11,0.08)
spacing.1semantic4px
spacing.3semantic12px
spacing.4semantic16px
status.caution.bgsemantic#F4EEDF
status.caution.fgsemantic#7A5D14
status.danger.bgsemantic#FBF0EE
status.danger.fgsemantic#B4342A
status.info.bgsemantic#EAF2F4
status.info.fgsemantic#12566E
status.positive.bgsemantic#D6E7DE
status.positive.fgsemantic#0F6A4E
surface.subtlesemantic#E7E3DA
text.primarysemantic#0A0A0B
text.secondarysemantic#555555
type.small.sizesemantic14px
weight.semiboldsemantic600

Accessibility

What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
Testing status by check
CheckHowStatus
axe-core rulesAutomated on every npm run check, at desktop and mobile widthRuns on every build
KeyboardAutomated Playwright test (scripts/keyboard.mjs)Not applicable
Screen readerManualNot tested yet

Semantics and focus

  • Icon is decorative; a visually hidden word (Success, Warning, Information, Error, Note) names the tone.
  • Text is text.primary on the tint; all tone pairs are in the contrast gate.
  • With announce, the message is a live region; only set it for messages that appear after an action.

Contrast

InlineMessage contrast pairings
PairingRatio (x:1)MinimumStatus
text.primary on surface.subtle15.454.5Pass
text.secondary on surface.subtle5.824.5Pass
status.positive.fg on status.positive.bg5.124.5Pass
status.caution.fg on status.caution.bg5.334.5Pass
status.info.fg on status.info.bg7.174.5Pass
status.danger.fg on status.danger.bg5.434.5Pass
text.primary on status.danger.bg17.724.5Pass
text.primary on status.info.bg17.444.5Pass
text.primary on status.caution.bg17.104.5Pass
text.primary on status.positive.bg15.404.5Pass