Inline Message

Inline messages provide contextual feedback about a specific action or state, inside the component they refer to.

Your changes have been saved.

Overview

Inline messages are persistent visual elements that communicate contextual information inside a component—such as a card, dialog, or form. They help users understand state, feedback, or important guidance related to the content they’re viewing.

In forms, inline messages may appear:

  • At the top of the form to share important informational content users should read first.
  • Above or below fields to provide field-specific context or validation.
  • At the bottom of the form to display confirmation or error information.

Usage

forge-inline-message communicates persistent, contextual guidance through theme, with optional icon and title slots. Place it directly beside or inside the component it refers to, such as a form, field, or card. For a page-level announcement, use a banner instead; for a reactive confirmation of an action, use a toast instead; for high-priority information that needs a decision, use a dialog instead.

Rules

Do
Place inline messages close to their related content (e.g., directly above a field).Use an inline message for reference or helper information scoped to a single component, like a form or field.Match the theme to the message severity; use the mildest theme that conveys the message accurately.Keep the message succinct — two lines or fewer where possible.Choose an icon that matches the message's theme (info, warning, success, error).Use title and message when emphasis or clarity is needed; omit the title for short messages.
Don't
Don't overuse multiple inline messages on one screen; this dilutes their impact.Don't stack conflicting themes together (e.g., success and error in the same region).Don't use an inline message for a page-level announcement — use a banner instead.Don't use an inline message to confirm an action the user just took — use a toast instead.Don't use an inline message for high-priority information that requires a decision — use a dialog instead.

With a title

Add a title slot above the message body when the message needs a short heading of its own.

A title slot sits above the message body.

Theme

Set theme to error, warning, success, info (the default), or info-secondary to match the message’s meaning, and pair it with an icon in the icon slot that reinforces the same meaning.

Every inline message theme, each paired with an icon.

Inline messages are used to provide feedback to the user about a specific action or state. Use inline messages to communicate information such as errors, warnings, or success messages in a way that is contextual to the content on the page.

import "@tylertech/forge/inline-message";
Properties
PropertyAttributeTypeDefaultDescription
themethemeInlineMessageTheme"info"The theme to apply.
Slots
NameDescription
(default)The message text.
titleThe title of the inline message.
iconThe icon to display.
CSS Parts
NameDescription
::part(root)The root layout element.
::part(container)The container element for the title and message content.
CSS Custom Properties
NameDescription
--forge-inline-message-backgroundThe background color.
--forge-inline-message-colorThe text color.
--forge-inline-message-shapeThe shape (border) radius.
--forge-inline-message-paddingThe padding around the content.
--forge-inline-message-padding-inlineThe inline padding around the content.
--forge-inline-message-padding-blockThe block padding around the content.
--forge-inline-message-border-widthThe border width.
--forge-inline-message-border-styleThe border style. Defaults to `none`.
--forge-inline-message-border-colorThe border color.
--forge-inline-message-gapThe gap/space between the content elements.
--forge-inline-message-icon-gapThe gap/space between the icon and the content.
--forge-inline-message-content-gapThe gap/space between the title and the message.
--forge-inline-message-icon-colorThe icon color.

Live-region behavior

For an important or urgent inline message, set role="alert" on forge-inline-message — this is equivalent to aria-live="assertive" and announces the message immediately. For something less urgent, use aria-live="polite" instead so it waits until the user finishes their current task before announcing.

Type to search the docs.

NavigateSelectClose
Loading Forge chat…