Skip to content

GhostInlineAlert ​

GhostInlineAlert is inline contextual feedback for errors, warnings, and recoverable failures near the content they describe. Import it from @ghostvue/themes for the default visual treatment. For headless markup with your own styles, see Advanced: headless composition.

Surface an actionable notice ​

Workspace billing status

Solid, soft, and outline GhostInlineAlert notices with contextual actions.

Workspace billing status

Contextual notices sit inline with the billing controls they affect.

Payment method declined

The card ending in 4242 failed authorization. Update billing details before Friday to avoid pausing background workers.

Annual invoice scheduled

Your Pro renewal ($348.00) is scheduled for December 1, 2026.

Storage at 82% of included quota

Artifact retention is set to 30 days. Adjust retention in workspace settings if you need more headroom.

The billing status card stacks solid, soft, and outline GhostInlineAlert variants from @ghostvue/themes, each next to the controls it affects. Actions sit in #actions, so Retry charge and Dismiss stay in the tab order. Outline and ghost buttons in a danger notice use the alert's foreground for their label and focus ring. Outline buttons also use it for the border. The notices are on the page from first paint, so they keep the default announce="off". The footer's role="status" line reports what each action did ("Payment retry queued.", "Usage notice dismissed."). Dismissing the usage notice moves focus to Restore dismissed, and restoring moves it back to Dismiss, because each press removes the button that was pressed.

Announce changes in place ​

Set announce to status or alert only when copy appears or changes after mount — for example after a failed save or a delayed load error. Do not use live semantics for copy that is present in the initial HTML with no later change unless you intentionally want a mount announcement.

announceRole on rootTypical use
off(none)Static contextual feedback present on first paint
statusstatusRecoverable or informational updates
alertalertUrgent errors needing immediate attention
Coastal feed status

One mounted announce="status" alert whose text changes in place from checking to partially unavailable to up to date while saved readings stay visible.

Coastal conditions

Checking 3 feeds…

Saved readings stay on screen until each feed responds.
  • Harbor buoy1.2 m swellUpdated 18 min ago
  • Pier wind14 kn SWUpdated 9 min ago
  • Tide gauge2.1 m risingUpdated 9 min ago

Three coastal feeds refresh in parallel. One alert with announce="status" stays mounted for the whole refresh, and its title and message change in place: "Checking 3 feeds…", then "Harbor buoy is unavailable" when one feed fails, then "Retrying harbor buoy…" and "All 3 feeds are up to date". Press the footer button to walk each response. Because the live region exists before its text changes, each update is announced politely; mounting a new alert per phase can drop announcements. Changing tone on the same alert keeps the region.

The saved buoy reading stays visible while its feed is down, and the other feeds update beside it. Each reading's age ("Updated just now", "Saved 18 min ago") sits outside the alert, so routine age changes are not announced. For an urgent failure that needs immediate attention, use announce="alert" instead.

Tones and variants ​

Themed inline alert

Soft danger styling from @ghostvue/themes.

Could not refresh rows

The server returned an error. Your last successful data is still shown below.

@ghostvue/themes adds these to the headless GhostInlineAlert API, which it forwards:

PropTypeDefaultDescription
variant'solid' | 'soft' | 'outline' | 'ghost'"soft"Visual treatment. The default omits data-variant.
tone'accent' | 'neutral' | 'danger' | 'success' | 'warning'"neutral"Semantic color intent, independent of variant and not a status enum. success and warning use the status tokens, as on GhostBadge; there is no info tone. The default omits data-tone.

Behavioral props (announce, headingLevel, as) pass through to the unstyled component. Defaults omit data-variant and data-tone so CSS treats missing hooks as soft / neutral.

Status tones ​

Service health

Neutral, success, warning, and danger soft alerts side by side, with transparent actions on the status tones.

Service health

Maintenance window on Sunday

Search indexing pauses from 02:00 to 03:00 UTC. Queries still return cached results.

API gateway is healthy

All 6 regions responded within 120 ms over the last hour.

Database replicas are degraded

Replica lag in eu-west is 45 seconds. Reads may return stale rows until it catches up.

Webhook delivery failed

38 events could not be delivered. They will retry automatically for 24 hours.

tone picks a color, not a status. The title and message say what happened, and announce still decides live-region semantics; tone never sets a role. Choose the tone that matches the copy:

  • neutral for informational notices, such as a planned maintenance window.
  • success for healthy or completed states.
  • warning for degraded states, or ones that need attention soon.
  • danger for failures.
  • accent for brand emphasis only.

Do not use accent to mean success. It follows the brand color, so it turns purple in Vibrant and is close to neutral in Mono. success and warning take their colors from the --ghost-status-success-* and --ghost-status-warning-* tokens, the same mapping as GhostBadge, so an alert and a badge beside it match. The title and message both use the status foreground. The solid variant swaps the status foreground and background and has no gradient. Outline and ghost buttons in #actions take the alert's text color, as they do in a danger alert. There is no info tone; use neutral.

Table and mutation failures ​

Use above or inside a table region for load and mutation failures. Keep actions in #actions so retry controls stay keyboard reachable.

Table load failure

Recoverable table error with a retry action.

Unable to load table

A network error prevented rows from loading. Cached data may be stale.

When not to use it ​

  • Global or transient feedback. Use GhostToast with GhostToastProvider and useGhostToast.
  • Field validation errors. Use GhostFieldError inside GhostField.
  • Always-on page chrome with announce="alert". That spuriously announces on every visit. Keep announce="off" for static copy.

Accessibility ​

  • Prefer announce="off" for copy present on first paint.
  • Use announce="alert" when an error appears after an async action.
  • Use announce="status" for recoverable informational updates after load.
  • Interactive controls belong in #actions; the root is not focusable.

Specification: GhostInlineAlert specification.

Advanced: headless composition ​

For teams that bring their own design system, the headless GhostInlineAlert from @ghostvue/vue renders the same parts and live-region roles with no styles.

Basic use ​

Static inline alert Headless

Title and message without live-region semantics.

Filters are active

Showing rows that match your current search.

The root is a native div by default. Use as="section" when the alert is a named landmark with a title. Static copy uses announce="off" (the default) so assistive technology reads it in document order without a live-region announcement.

Composable inline alert Headless

useGhostInlineAlert bindings on a section root.

Recoverable warning

Some rows were skipped during import.

Headless post-mount alert ​

Post-mount alert Headless

announce=alert after a simulated failure.

The alert mounts with announce="alert" after a simulated save failure.

Styling ​

The unstyled root uses class ghost-inline-alert, data-part="root", and data-ghost-inline-alert. Slot wrappers use data-part="title", message, and actions. There is no data-state hook.

API ​

PropTypeDefaultDescription
announceGhostInlineAlertAnnounce"off"Live-region behavior. Default off for static inline feedback. Use status or alert only when copy appears or changes after mount.
asGhostInlineAlertElement"div"Root element. Prefer div inside table cells.
headingLevelGhostInlineAlertHeadingLevel3Heading level wrapping the title slot.
SlotSlot propsDescription
actions—Optional action controls such as GhostButton. Children stay focusable.
message—Primary supporting copy.
title—Optional heading. Rendered as h1–h6 from headingLevel.

Slots: #title, #message, #actions. Native attributes fall through to the root. A template ref exposes element: HTMLElement | null.

When #title is present, as is section, and announce is off, the root receives aria-labelledby pointing at the heading id generated by useGhostId.