Inline Message
Introduction
Section titled “Introduction”A compact, one-line status shown next to the content it describes, such as “Saved 2 minutes ago” or “Offline”. InlineMessage renders a tone icon, a visually hidden localized tone prefix (“Warning:”), and the text. Tone is never conveyed by color alone. It is static by default; set live for status that changes while the user works.
- Next to the contentA short status line placed beside the field or section it is about.
- Four tonesInfo, success, warning, and error with matching icons and colors.
- Live region optionAnnounce changes politely or assertively, or stay silent for static text.
Use it for
- Short status beside a heading, toolbar, card, or value: save state, connection state, sync state.
- Status that changes while the user works, with live set to ‘polite’.
Use something else for
- Messages that need a title, actions, or dismissal: use Alert.
- Transient confirmations: use Toast.
- Field validation errors: use the field’s own error message or Validation Message.
Anatomy
<span class="aui-inline-message aui-inline-message--{tone}" [role=status|alert]> <span class="aui-inline-message__icon">icon (aria-hidden)</span> <span class="aui-inline-message__tone">Warning: (visually hidden)</span> <span class="aui-inline-message__text">message</span></span>Live example
Section titled “Live example”Use the bar above each frame to switch theme, density, direction, and locale.
Inline Message in the Status center showcase
Section titled “Inline Message in the Status center showcase”The part of the Status center showcase that uses Inline Message. Change its options, use it with the keyboard, and watch the event log; the link in the frame opens the full showcase. The bar above the frame switches theme, density, direction, and locale.
Showcase source
// Feedback showcase: a status center with alerts, inline messages, toasts, a progress bar// driven by a simulated job, spinners, and skeletons while content loads.import { Alert } from '@absoluteui/components/alert';import { Button } from '@absoluteui/components/button';import { InlineMessage } from '@absoluteui/components/inline-message';import { ProgressBar } from '@absoluteui/components/progress-bar';import { Skeleton } from '@absoluteui/components/skeleton';import { Spinner } from '@absoluteui/components/spinner';import { Toaster, toast } from '@absoluteui/components/toast';import { action, choice, createShowcase, hostIn, section, toggle, wait } from './kit.js';
type Tone = 'info' | 'success' | 'warning' | 'error';
const sc = createShowcase({ title: 'Status center', description: 'Alerts, inline messages, toasts, progress, spinners, and skeletons, each with the right live-region behavior.',});
Toaster.create({ position: 'bottom-end', max: 3, duration: 5000 });let tone: Tone = 'info';
const alerts = section(sc, 'Alerts', ['alert']);const alert = Alert.create(hostIn(alerts), { tone: 'warning', title: 'Payroll closes Friday', message: 'Approve all timesheets by Thursday 17:00 to include them in this month.', dismissible: true, actions: [{ label: 'Review timesheets', value: 'review', variant: 'primary' }, { label: 'Remind me later', value: 'later' }],});sc.listen(alert.host, ['aui-action', 'aui-dismiss'], 'alert');
const inline = section(sc, 'Inline messages', ['inline-message']);(['info', 'success', 'warning', 'error'] as const).forEach((t) => InlineMessage.create(hostIn(inline), { tone: t, message: { info: 'Changes are saved automatically.', success: 'Profile updated.', warning: 'Your certificate expires in 12 days.', error: 'The export failed. Try again.' }[t] }),);
const progressSection = section(sc, 'Progress', ['progress-bar']);const bar = ProgressBar.create(hostIn(progressSection), { label: 'Exporting 1,200 records', value: 0, max: 100, showValue: true, announceComplete: true, description: 'You can keep working while the export runs.' });ProgressBar.create(hostIn(progressSection), { label: 'Connecting to the bank', value: null });const spinnerSection = section(sc, 'Spinners', ['spinner']);const spinners = hostIn(spinnerSection);spinners.className = 'sc-row';(['sm', 'md', 'lg'] as const).map((size) => Spinner.create(hostIn(spinners), { size, label: `Loading (${size})`, showLabel: size === 'lg' }));
const loading = section(sc, 'Loading content', ['skeleton']);const card = hostIn(loading);card.className = 'sc-skeleton-card';const skeletons = [Skeleton.create(hostIn(card), { shape: 'circle', width: '3rem', height: '3rem' }), Skeleton.create(hostIn(card), { lines: 3 })];Skeleton.markBusy(card, true);
const toasts = section(sc, 'Toasts', ['toast']);const toastIntro = document.createElement('p');toastIntro.textContent = 'Toasts appear at the bottom end of the page, at most three at a time, and close after five seconds. Choose the tone in the options; Run export ends with a toast that has an action.';toasts.append(toastIntro);const toastRow = hostIn(toasts);toastRow.className = 'sc-row';const showToast = Button.create({ text: 'Show toast', variant: 'secondary' }, document);toastRow.append(showToast.element);
const runExport = async (): Promise<void> => { bar.update({ tone: 'default' }); for (let v = 0; v <= 100; v += 10) { bar.setValue(v); await wait(250); } bar.update({ tone: 'success' }); toast({ tone: 'success', title: 'Export ready', message: 'export-2026-11.csv is ready to download.', action: { label: 'Download', onAction: () => { sc.log('toast action: download'); } } }); sc.log('export finished');};
action( sc, 'Run export', () => { void runExport(); }, ['progress-bar', 'toast'],);showToast.element.addEventListener('click', () => { toast({ tone, message: { info: 'Three people joined your team.', success: 'Settings saved.', warning: 'You are offline. Changes will sync later.', error: 'Could not reach the server.' }[tone] }); sc.log('toast shown', { tone });});action(sc, 'Show alert again', () => { alert.update({ title: 'Payroll closes Friday' }); if (!alert.host.isConnected || alert.host.hidden) alerts.append(alert.host); alert.host.hidden = false;}, ['alert']);choice<Tone>( sc, 'Toast tone', [ { value: 'info', label: 'Info' }, { value: 'success', label: 'Success' }, { value: 'warning', label: 'Warning' }, { value: 'error', label: 'Error' }, ], 'info', (t) => { tone = t; }, ['toast'],);toggle(sc, 'Content loaded', false, (loaded) => { Skeleton.markBusy(card, !loaded); if (loaded) { for (const s of skeletons) s.destroy(); card.textContent = 'Ada Lovelace, Engineering lead. 12 open reviews.'; }}, ['skeleton']);Save state next to a document title
Section titled “Save state next to a document title”import { InlineMessage } from '@absoluteui/components/inline-message';
const host = document.createElement('span');document.body.append(host);const status = InlineMessage.create(host, { tone: 'info', message: 'Saving', live: 'polite' });status.update({ tone: 'success', message: 'Saved just now' });Connection state
Section titled “Connection state”import { InlineMessage } from '@absoluteui/components/inline-message';
const host = document.createElement('span');document.body.append(host);const connection = InlineMessage.create(host, { tone: 'success', message: 'Online', live: 'polite' });window.addEventListener('offline', () => { connection.update({ tone: 'warning', message: 'Offline' });});window.addEventListener('online', () => { connection.update({ tone: 'success', message: 'Online' });});Install and start
Section titled “Install and start”npm install @absoluteui/components @absoluteui/core @absoluteui/themeRegistry setup, the theme stylesheet, and the Content Security Policy are covered in Installation.
import { InlineMessage } from '@absoluteui/components/inline-message';import '@absoluteui/components/inline-message/style.css';First use
Section titled “First use”import { InlineMessage } from '@absoluteui/components/inline-message';import '@absoluteui/components/inline-message/style.css';
const host = document.querySelector<HTMLElement>('#connection');if (host) { const connection = InlineMessage.create(host, { tone: 'success', message: 'Online', live: 'polite' }); window.addEventListener('offline', () => { connection.update({ tone: 'warning', message: 'Offline' }); });}More usage
import { InlineMessage } from '@absoluteui/components/inline-message';
const host = document.querySelector<HTMLElement>('#save-state');if (host) { const state = InlineMessage.create(host, { tone: 'info', message: 'Saving', live: 'polite' }); state.update({ tone: 'success', message: 'Saved just now' });}Using Angular? See Inline Message for Angular.
API reference
Section titled “API reference”Factory
Section titled “Factory”InlineMessage.create(host: HTMLElement, options: InlineMessageOptions): InlineMessageGlobal configuration key: inlineMessage (see Configuration).
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
message |
string |
Message text. Required. | |
tone |
'info' | 'success' | 'warning' | 'error' |
"info" |
Tone: icon, colors, and hidden tone prefix. |
live |
'off' | 'polite' | 'assertive' |
"off" |
off: static; polite: role=status; assertive: role=alert. |
icons |
Partial<InlineMessageIcons> |
Icon slot overrides. | |
locale |
string |
"en-US" |
Locale of the tone prefix. Globally configurable. Inherited from common configuration. |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
host |
HTMLElement |
The host element (receives role and classes). |
message |
string |
Current message. |
options |
Readonly<InlineMessageOptions> |
Current options. |
Methods
Section titled “Methods”| Method | Description |
|---|---|
update(options: Partial<InlineMessageOptions>): void |
Merge and apply options; text changes in place (announced when live). |
destroy(): void |
Remove rendering, role, classes, and subscriptions. |
CSS classes
Section titled “CSS classes”All rules live in the aui.components cascade layer, so application styles override them without specificity battles.
| Class | Purpose |
|---|---|
aui-inline-message |
Host. |
aui-inline-message--info | --success | --warning | --error |
Tone modifiers. |
aui-inline-message__icon |
Tone icon (decorative). |
aui-inline-message__tone |
Visually hidden tone prefix. |
aui-inline-message__text |
Message text. |
Icon slots
Section titled “Icon slots”| Slot | Default icon |
|---|---|
info |
info |
success |
check-circle |
warning |
alert-triangle |
error |
alert-circle |
Design tokens
Section titled “Design tokens”Tokens this stylesheet reads (verified in CI). Override them in a theme or with the Theme Designer.
--aui-border-width | --aui-color-error-fg | --aui-color-error-subtle | --aui-color-info-fg | --aui-color-info-subtle | --aui-color-success-fg | --aui-color-success-subtle | --aui-color-text | --aui-color-warning-fg | --aui-color-warning-subtle | --aui-font-family-sans | --aui-font-size-sm | --aui-icon-size-sm | --aui-line-height-normal | --aui-radius-pill | --aui-space-1 | --aui-space-2
TypeScript definitions
type InlineMessageTone = 'info' | 'success' | 'warning' | 'error';type InlineMessageLive = 'off' | 'polite' | 'assertive';interface InlineMessageIcons { info: IconRef; success: IconRef; warning: IconRef; error: IconRef }interface InlineMessageOptions { message: string; tone?: InlineMessageTone; live?: InlineMessageLive; locale?: string; icons?: Partial<InlineMessageIcons>;}Accessibility and performance
Section titled “Accessibility and performance”Accessibility
Section titled “Accessibility”Pattern: Status message (WCAG 4.1.3): role=status for polite updates, role=alert for urgent ones, plain text when static.
Checked on every docs build: the showcase passes axe (WCAG 2.2 A and AA rules) in the default, dark, and high-contrast themes and right to left; the playground loads without errors and passes axe before and after every on/off option is switched, with no Content Security Policy violations.
Keyboard
Section titled “Keyboard”| Key | Context | Action |
|---|---|---|
| None | Any | Not focusable; read in document order by assistive technology. |
| Element | Role |
|---|---|
| host | none (live ‘off’), status (live ‘polite’), or alert (live ‘assertive’) |
| icon | none (aria-hidden=true) |
ARIA attributes
Section titled “ARIA attributes”| Attribute | Element | Value |
|---|---|---|
role |
host | status or alert when live is enabled; absent otherwise |
Never receives or moves focus.
WCAG 2.2 success criteria addressed
Section titled “WCAG 2.2 success criteria addressed”| Criterion | Level | Note |
|---|---|---|
| 1.3.1 Info and Relationships | A | |
| 1.4.1 Use of Color | A | |
| 1.4.3 Contrast (Minimum) | AA | |
| 1.4.11 Non-text Contrast | AA | |
| 4.1.3 Status Messages | AA |
Automated test results: Accessibility and compliance.
Notes and known caveats
Section titled “Notes and known caveats”- Tone is conveyed by an icon and a visually hidden, localized prefix such as ‘Error:’, never by color alone.
- Live roles announce only changes made after the region exists; create it with live set, then call update().
- Manual screen-reader verification (NVDA, JAWS, VoiceOver) is pending.
Performance
Section titled “Performance”| Import cost | Minified | gzip | brotli | CSS brotli |
|---|---|---|---|---|
@absoluteui/components/inline-message |
31.4 kB | 11.0 kB | 9.7 kB | 0.5 kB |
Measured at build time, including every AbsoluteUI module the component pulls in. No third-party runtime dependencies.
| Budget (enforced in CI) | Limit |
|---|---|
| InlineMessage.create, per instance | < 1 ms average in headless Chromium |
Tested scale: Unit-tested per instance; not data-driven.
Constant work per render: one icon and two text updates.
Measured run times: Performance.
Details
Section titled “Details”States
info, success, warning, error; live polite; live assertive.
State transitions
| From | Trigger | To |
|---|---|---|
| any | update({ tone, message }) |
new tone and text (announced when live) |
| any | destroy() |
host restored to empty |
Accessibility notes
- Live roles only announce changes made after the live region exists. Create the message with
liveset, then change it withupdate(). - Do not update a live message on every keystroke or timer tick. For example, refresh “Saved 2 minutes ago” without
live, and useliveonly for state changes such as Saving -> Saved. - The e2e axe run (WCAG 2.2 AA, 3 themes) and manual screen-reader verification are pending.
Responsive behavior
An inline-flex pill, limited to the container width; long text wraps.
Right-to-left
Logical properties: the icon sits at the inline start.
Theming
color-{tone}-subtle background, color-{tone}-fg icon, and color-text text; these pairs are in the contrast gate. Forced-colors mode adds a CanvasText border and icon.
Global configuration
Only the inherited locale is configurable:
configureAbsoluteUI({ components: { inlineMessage: { locale: 'de-DE' } } });Component configuration
The instance locale overrides global and theme configuration. Configuration changes re-render existing messages.
Timezones
Not applicable. Relative times such as “Saved 2 minutes ago” are formatted by the consumer.
Icons
icons.info (default info), icons.success (check-circle), icons.warning (alert-triangle), icons.error (alert-circle).
Security
The message uses textContent; it is never parsed as HTML. CSP-safe.
Data handling
No persistence, network access, or telemetry.
Supported data scale
Not data-driven.
Edge cases
- Changing only
tonere-announces a live message, because the tone prefix is part of the content. - Setting
liveon a message that is already displayed does not announce the existing text.
Errors
| Code | Category | Cause |
|---|---|---|
INLINE_MESSAGE_OPTIONS |
configuration | Missing or blank message, or unknown tone or live value. |
ICON_UNKNOWN |
configuration | Unknown icon override. |
CFG_INVALID_VALUE / CFG_UNKNOWN_OPTION |
configuration | Invalid or unknown configuration. |
Invalid options throw before the host is modified; an invalid update() leaves the previous state intact.
Known limitations
- Text only.
- Manual screen-reader verification is pending.
Unsupported scenarios
- HTML or
Nodecontent. - Actions or dismissal: use Alert.
(c) 2026 Kasadara Technology Solutions Pvt Ltd. AbsoluteUI is free to use under the AbsoluteUI Free Use License; it is not open source.