Angular Ladeanzeige & Overlay | ng-hub-ui-loading

Angular-Ladekomponente mit Spinner-, Dots-, Bars-, Pulse- und Ring-Indikatoren in den Modi inline, overlay und fullscreen, dazu ein Service für anwendungsweit blockierende Overlays.

Interaktive Beispiele

Erkunde Live-Beispiele, die zeigen, wie sich die Bibliothek in gängigen Angular-Anwendungsfällen verhält.

Inline-Block

`inline` ist der Standardmodus, weil ein noch leerer Bereich den Platz, den sein Inhalt einnehmen wird, bereits reservieren sollte: Der Block nimmt am normalen Dokumentfluss teil, sodass beim Eintreffen des echten Inhalts nichts springt. `message` wird unter dem Indikator gerendert, und alles zwischen den Tags Projizierte erscheint unter der Meldung — der Platz für eine Abbrechen-Aktion oder einen Hinweis, dass der Vorgang länger dauert als üblich. Der Host trägt `role="status"`, `aria-live="polite"` und `aria-busy="true"`, sodass ein Screenreader die Meldung beim Erscheinen aufnimmt, ohne das Vorgelesene zu unterbrechen.

Grundlagen des Inline-Blocks

Indicator only

Loading your workspace

With a message

Importing 1,248 rows

With projected content

The block is announced as role="status" with aria-live="polite", so a screen reader reads the message when it appears without interrupting whatever is being read.

Indikatoren und Akzente

Die Bibliothek bringt fünf reine CSS-Indikatoren mit — `spinner`, `dots`, `bars`, `pulse` und `ring` — und zieht damit weder eine Bilddatei noch eine Icon-Schrift nach. Drei Größenstufen setzen `--hub-loading-size` vor, und das Token bleibt eigenständig überschreibbar, wenn ein Layout eine Größe braucht, die diese Stufen nicht abdecken. `color` ist keine gewöhnliche CSS-Farbe: Der Wert läuft durch `resolveHubAccent()`, das einen bloßen Namen wie `primary` als Design-System-Token liest, der dem Theme folgt, während ein Hex-Wert, ein `oklch()`-Literal oder eine `var(...)`-Referenz unverändert übernommen wird.

Varianten, Größen und Akzente

Variants
spinner
dots
bars
pulse
ring
Sizes
size="sm"
size="md"
size="lg"

Each step is a preset for the --hub-loading-size token. Override that token directly when a layout needs a size the three steps do not cover.

Accents
color="primary"
color="success"
color="danger"
color="#7c3aed"
color="var(--hub-sys-color-warning)"

A bare name resolves to var(--hub-sys-color-<name>) and tracks the active theme. A hex, an oklch() or a var(...) is used verbatim.

Overlay und Fullscreen

`overlay` deckt einen Bereich statt der ganzen Seite ab. Es wird absolut positioniert, also entscheidet der nächste positionierte Vorfahre, was verdeckt wird — gib diesem Container `position: relative`, sonst entkommt das Overlay nach oben zu irgendeinem zufällig positionierten Vorfahren. Diese Eingrenzung hält den Rest des Bildschirms scrollbar und nutzbar. `fullscreen` ist am Viewport fixiert und genau das, was `HubLoadingService` an `document.body` hängt — außerhalb jedes Komponenten-Teilbaums, sodass kein `overflow` und kein Stacking-Kontext eines Vorfahren es abschneiden kann. Beide Modi zeichnen den durchscheinenden Schleier, sofern `backdrop` nicht abgeschaltet wird.

Container-Overlay

Order #4821

3 items · delivered 14 Aug 2026

Subtotal
212.00 €
Shipping
9.90 €
VAT (21%)
26.70 €
Total
248.60 €

Turn the backdrop off to keep the content readable underneath — useful when the work is a background refresh rather than something that invalidates what is on screen.

Fullscreen-Service

The overlay covers the whole viewport, so this demo dismisses it for you: every request releases its own reference, and a watchdog forces a hideAll() after 5 seconds no matter what.
References held
0
isLoading()
false
Calls

Nothing yet.

Vollbild innerhalb einer Hülle

Workspace

The indicator below is declared here, inside the container's content — the place a real application would write it.

Restoring the last session…

Three documents, two of them shared.

Last sync: 23 Sep 2026, 09:14.

Notes

With hoisting off, the overlay still covers the window — the containment went in 22.15.0 — but it paints under this panel, because the container keeps a stacking context of its own. Leaving the subtree is the only fix that does not depend on what an ancestor declares.

The overlay clears itself after a couple of seconds, and a click anywhere on it dismisses it at once.

Branding und Theming

`image` tauscht den eingebauten Indikator gegen eine eigene Marke, animiert mit `none`, `spin` oder `pulse`: `spin` wirkt nur bei einer radialsymmetrischen Marke stimmig, während `pulse` eine Wortmarke aufrecht und lesbar hält. Alles Visuelle steckt in den `--hub-loading-*`-Tokens, deklariert auf `:where(.hub-loading)`, sodass jeder Vorfahre sie setzen kann — Akzent, Größe, Geschwindigkeit, Strichstärke, Abstand, Bildgröße, Textfarbe sowie Tönung und Weichzeichnung des Backdrops. Das Sass-Mixin `hub-loading-theme()` setzt die gesamte Token-Leiter in einem Aufruf, und `provideHubLoading()` legt die Standardwerte für eine ganze Anwendung neu fest, ohne ein Template anzufassen.

Markenbild

Preparing your report

imageAnimation="none"

Preparing your report

imageAnimation="spin"

Preparing your report

imageAnimation="pulse"

Any URL works — an asset path, an imported file or, as here, an inline data URI. Size the mark with --hub-loading-image-size rather than size, which drives the built-in indicators.

Theming über CSS-Variablen

Inline — accent, size, speed, thickness

Overlay preview

The backdrop tint and blur only apply in overlay and fullscreen modes. The tint is mixed from --hub-sys-surface-page, so it veils this text with the theme's own surface instead of a fixed colour — drop it to zero and the card stays fully legible underneath.

Refreshing

The same overrides written once, in Sass, are in the CSS tab — that is what hub-loading-theme() is for.

Seitenfortschrittsleiste

`hub-loading-bar` ist der schmale Streifen, der meldet, dass die Seite selbst unterwegs ist — der unter der Navigationsleiste. Drei Entscheidungen machen ihn glaubwürdig. Er zählt seine Aufrufer: eine Navigation und die drei Anfragen der Seite sind vier Referenzen, und die Leiste endet mit der letzten, nicht mit der ersten. Er wartet, bevor er überhaupt etwas zeichnet: Arbeit, die innerhalb der Karenzzeit fertig wird, zeigt gar keine Leiste, denn eine 40-ms-Route, die kurz einen Fortschrittsbalken aufblitzen lässt, wirkt wie ein Fehler und nicht wie Tempo. Und das Trickle wird langsamer, je voller die Leiste ist, und bleibt vor dem Ende stehen — hier kennt niemand den echten Prozentsatz, also darf nur `complete()` 100 % zeigen, weil nur `complete()` weiß, dass es stimmt. Platzieren Sie sie mit `mode="overlay"` in einer positionierten Navigationsleiste oder mit `mode="fixed"` und `--hub-loading-bar-offset`, wenn die Navigationsleiste selbst fixiert ist.

Seitenfortschrittsleiste

Acme
Orders

This page arrived without you watching a spinner.

progress 0% · painted: false

Bekannter und unbekannter Fortschritt

Known percentage
[progress]="null"

A real value, so the bar announces it. Reaching 100% is the caller's call, not the trickle's.

No percentage at all
indeterminate

A sweep instead of a fill, for a stream or a job that reports no stages. No value is announced, because there is none.

Both bars are mode="inline", so each reserves its own row and nothing on the card moves when a bar appears or goes away.

Router- und HTTP-Anbindung

Dashboard
Callers
0
isActive()
false
progress()
0%
Calls

Nothing yet.

Lauf von rechts nach links

Loading results…
dir="ltr"

Sweeps left to right, with the text.

جارٍ تحميل النتائج…
dir="rtl"

يمسح من اليمين إلى اليسار، مع اتجاه النص.

The flip comes from [dir='rtl'] .hub-loading-bar, .hub-loading-bar[dir='rtl'], so the attribute counts wherever it sits — on <html>, on the region that changes direction, or on the <hub-loading-bar> element itself. The determinate fill needs no such treatment: it grows along the inline axis, which already reverses on its own.