Skip to main content
Pricing

Inline Message

Free

A compact, contextual message displayed directly beneath a form field or within a content section. Used for field-level validation feedback, helper text upgrades, and contextual warnings. Appears inline without displacing the layout. Supports info, success, warning, and error severity levels with matching icon and colour.

8 variants

Variant
This is info inline feedback.

Variants

VariantDescriptionWhen to use
InfoBlue-toned inline message for supplementary context.Use to provide additional guidance below a form field — "We'll use this to personalise your experience".
SuccessGreen-toned inline message confirming valid input.Use for real-time validation confirmation — "Username is available".
WarningAmber-toned inline message for non-blocking concerns.Use to flag potential issues — "This email is already associated with another account".
ErrorRed-toned inline message for validation failures.Use for field-level validation errors — "Password must be at least 8 characters".

Usage Guidelines

Do

Position directly below the related form field with no gap.

Don't

Use for page-level or system-level messages — use Alert or Banner instead.

Do

Associate the message with the field using aria-describedby.

Don't

Display multiple inline messages on the same field — show only the highest priority.

Do

Use a severity icon alongside the text for colour-blind accessibility.

Don't

Use inline messages without associating them to a field — they lose context.

Do

Keep messages to a single sentence with actionable guidance.

Don't

Code

HTML
<div class="lex-inline-message lex-inline-message--error"
  id="email-error" role="alert">
  <svg class="lex-inline-message__icon" aria-hidden="true">
...
CSS Custom Properties
.lex-inline-message {
  display: flex;
  align-items: flex-start;
  gap: var(--lex-space-4);
...
React
// Using Lexicon CSS classes with React

<InlineMessage severity="error" id="email-error">
...

Design Tokens

TokenValue (dark)Value (light)CSS property
--lex-inline-msg-bgbg
--lex-inline-msg-borderborder
--lex-inline-msg-texttext
--lex-inline-msg-radiusradius

Accessibility

  • Associate the message with its form field using aria-describedby on the input pointing to the message id.
  • Use role="alert" for error messages so they are announced immediately.
  • Icon must have aria-hidden="true" since the text conveys the meaning.
  • When the message is removed, ensure the aria-describedby reference is also cleaned up.

Keyboard Interactions

TabFocus moves to the associated form field; the inline message is read as part of the field description.