LoadingOverlay
Block a container or the complete viewport with flicker-safe timing, native top-layer behavior, focus restoration and customizable progress feedback.
GET STARTED
Import
Import the canonical overlay and include the indicator directive only for a custom template.
Container loading
Only projected content becomes busy and inert. The layer remains inside its component boundary.
Viewport loading
Native dialog top-layer behavior stays above fixed headers, locks document scroll and restores the trigger focus.
Custom indicator
Replace only the visual indicator while LoadingOverlay retains blocking, timing and status semantics.
Non-blocking background work
Set blockInteraction=false only when continued interaction is safe. Busy semantics remain active.
Flicker-safe timing
Busy state begins immediately. The default 150 ms delay hides short tasks; once visible, the overlay remains for at least 300 ms.
Unstyled and typed class slots
Structural positioning, timing, inert behavior and focus management remain while consumer classes own the visual layer.
LOADINGOVERLAY
Accessibility
Busy feedback is announced without making a loading operation dismissible.
Busy and inert
aria-busy starts with application state, even during delay. Blocking mode makes projected content inert.
Focus and scroll
Blocking overlays receive programmatic focus. Viewport scope reference-counts scroll locks and restores the connected opener after hiding.
Announcements
The built-in ProgressSpinner owns its accessible label. Custom indicators receive polite status semantics from the panel.
Dismissal policy
Escape and backdrop interaction never cancel work. Application state is the only authority that hides the loader.
LOADINGOVERLAY
API
Complete contract of NeuralLoadingOverlay.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| active | boolean | false | Immediate application busy state. |
| scope | 'container' | 'viewport' | 'container' | Blocking boundary. |
| label | string | null | null | Task label; localized Loading fallback. |
| showLabel | boolean | true | Shows the task label visually. |
| backdrop | boolean | true | Renders the visual backdrop. |
| blockInteraction | boolean | true | Makes content inert and captures interaction. |
| lockScroll | boolean | true | Reference-counted viewport scroll lock. |
| delay | number | 150 | Defers visual rendering to avoid flashes. |
| minimumDuration | number | 300 | Minimum visible time once rendered. |
| spinnerSize | ProgressSpinner size | 'large' | Built-in indicator size. |
| spinnerSeverity | ProgressSpinner severity | 'info' | Built-in indicator color. |
| unstyled | boolean | false | Removes NeuralNg visual classes. |
| overlayClass | string | '' | Consumer root class. |
| classes | NeuralLoadingOverlayClasses | {} | Typed visual slots. |
Events
shownvoidThe delayed visual layer rendered.
hiddenvoidThe minimum-duration layer was removed.
Template directive
NeuralLoadingIndicator targets ng-template[neuralLoadingIndicator] and replaces only the indicator.
Typed class slots
rootcontentbackdroppanelindicatorlabelScope contract
Container uses an absolute local layer. Viewport uses native dialog top layer. Neither mode moves application content into a global append target.
LOADINGOVERLAY
Design tokens
Component tokens
--neural-loading-overlay-z-indexComponent stacking order.
--neural-loading-overlay-viewport-z-indexViewport stacking order.
--neural-loading-overlay-backdropComponent backdrop color.
--neural-loading-overlay-backdrop-filterComponent backdrop filter effect.
--neural-loading-overlay-panel-gapSpacing between panel items.
--neural-loading-overlay-panel-min-widthPanel minimum inline size.
--neural-loading-overlay-panel-paddingPanel internal spacing.
--neural-loading-overlay-panel-colorPanel foreground color.
--neural-loading-overlay-panel-backgroundPanel background surface.
--neural-loading-overlay-panel-borderPanel border shorthand.
--neural-loading-overlay-panel-radiusPanel corner radius.
--neural-loading-overlay-panel-shadowPanel box shadow.
--neural-loading-overlay-label-colorLabel foreground color.
--neural-loading-overlay-label-font-sizeLabel font size.
--neural-loading-overlay-enter-durationComponent enter animation duration.
--neural-loading-overlay-enter-distanceComponent enter animation travel distance.
--neural-loading-overlay-enter-scaleComponent enter animation starting scale.