Feedback
InlineMessage
Message next to the content it is about: success, warning, information or error.
- Experimental
- No keyboard interaction
- Screen reader not tested yet
Playground
Saved
<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
- Say what happened and what to do next.
- Place it directly above or below the content it refers to.
- 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
- containerTinted box with a 1px border in the tone colour.
- iconShape differs per tone, so colour is never the only signal.
- titleOptional, semibold.
- bodySmall text in text.primary.
Examples
Positive
Request sent
Caution
Info
Danger
Upload failed
Neutral
Props
| Name | Type | Default | Description |
|---|---|---|---|
| tone | "neutral" | "positive" | "caution" | "info" | "danger" | "info" | Sets icon, tint and the word screen readers hear first. |
| title | string | – | Short bold first line. |
| children | ReactNode | – | One or two sentences. |
| announce | boolean | false | Announce on appearance: danger as alert, other tones as status. |
Tokens used
| Token | Tier | Value | Utility |
|---|---|---|---|
| input.radius | component | 8px | |
| border.hairline | semantic | rgba(10,10,11,0.08) | |
| spacing.1 | semantic | 4px | |
| spacing.3 | semantic | 12px | |
| spacing.4 | semantic | 16px | |
| status.caution.bg | semantic | #F4EEDF | |
| status.caution.fg | semantic | #7A5D14 | |
| status.danger.bg | semantic | #FBF0EE | |
| status.danger.fg | semantic | #B4342A | |
| status.info.bg | semantic | #EAF2F4 | |
| status.info.fg | semantic | #12566E | |
| status.positive.bg | semantic | #D6E7DE | |
| status.positive.fg | semantic | #0F6A4E | |
| surface.subtle | semantic | #E7E3DA | |
| text.primary | semantic | #0A0A0B | |
| text.secondary | semantic | #555555 | |
| type.small.size | semantic | 14px | |
| weight.semibold | semantic | 600 |
Accessibility
| Check | How | Status |
|---|---|---|
| axe-core rules | Automated on every npm run check, at desktop and mobile width | Runs on every build |
| Keyboard | Automated Playwright test (scripts/keyboard.mjs) | Not applicable |
| Screen reader | Manual | Not 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
| Pairing | Ratio (x:1) | Minimum | Status |
|---|---|---|---|
| text.primary on surface.subtle | 15.45 | 4.5 | Pass |
| text.secondary on surface.subtle | 5.82 | 4.5 | Pass |
| status.positive.fg on status.positive.bg | 5.12 | 4.5 | Pass |
| status.caution.fg on status.caution.bg | 5.33 | 4.5 | Pass |
| status.info.fg on status.info.bg | 7.17 | 4.5 | Pass |
| status.danger.fg on status.danger.bg | 5.43 | 4.5 | Pass |
| text.primary on status.danger.bg | 17.72 | 4.5 | Pass |
| text.primary on status.info.bg | 17.44 | 4.5 | Pass |
| text.primary on status.caution.bg | 17.10 | 4.5 | Pass |
| text.primary on status.positive.bg | 15.40 | 4.5 | Pass |