Skip to content
Protocore Design Systemv1.6.9

/// Feedback

InlineLoading

An inline spinner + label that resolves to a success check or an error cross, driven by a state prop.

import { InlineLoading } from "@protocore/pds";
View as Markdown

The three states

state drives the indicator: "loading" shows a spinner, "success" a check, "error" a cross — each with its own label. The state is fully controlled by you, so it fits naturally at the end of a save or upload flow.

Saving changes…
Changes saved
Save failed

In a form action

Wire it next to a submit button: flip to loading on click, then to success or error when the request settles. The polite live region announces each transition to assistive tech.

When to use it

InlineLoading is for the small, in-place feedback that belongs beside the control that triggered it — a "Saving… / Saved" beside a form button, a per-row upload state, an inline validation check. It keeps the outcome next to the cause instead of firing a toast across the screen.

For a blocking, full-surface wait use LoadingOverlay; for indeterminate progress with no resolution use Spinner; for a determinate bar use ProgressBar. Keep the success and error states on screen only briefly, then return to idle or remove the component.

Usage

Do

  • Place it beside the control that started the action.
  • Change the `label` with the state ("Saving…" → "Saved").
  • Return to `idle` (or unmount) shortly after resolving.
  • Use the error state for the failure, then offer a retry.

Don't

  • Leave a success check on screen indefinitely; it's a transient.
  • Use it for a page-blocking wait; that's LoadingOverlay.
  • Rely on the icon color alone — always pair it with a label.

Accessibility

  • The root is a polite live region (`role="status"`), so state transitions are announced without stealing focus.
  • The check and cross are decorative SVGs (`aria-hidden`); the meaning is carried by the text label, never by color alone.

InlineLoading props

PropTypeDefaultDescription
classNamestring
labelReactNodeThe text shown beside the indicator.
stateenumloadingWhich phase to render.
styleCSSProperties

Related

  • SpinnerA minimal 1em border spinner that announces an indeterminate loading status inline.
  • ProgressBarA thin track that fills to value/max, or sweeps indeterminately when value is omitted.
  • LoadingOverlayA scrim + centered spinner that covers its positioned parent and blocks interaction during loading.
  • NotificationA standalone tone-ruled notification card with an optional icon, loading state, action, and close button.