MatExpLoadingIndicator
mat-exp-loading-indicatorMaterial 3 Expressive loading indicator. Renders a continuously morphing and rotating shape that loops through the seven canonical M3 shapes.
All animation work is driven by GSAP – there are no CSS keyframes:
- Entry – Angular's
(animate.enter)event binding hands control to GSAP, which fades the wrapper fromautoAlpha: 0 / scale: 0.85 → 1over ~200ms (power2.out) and callsevent.animationComplete()once the tween finishes. - Exit –
(animate.leave)runs the inverse tween over ~150ms (power2.in); Angular waits foranimationComplete()before detaching the element from the DOM. - Rotation & shape morph – modelled on the Compose Material3
LoadingIndicatorchoreography:- a continuous linear background rotation on a wrapper
<g>(intervalMs × ~7.178per full revolution, matching Compose's ratio), - on top of it, a per-step spring that morphs the inner
<path>to the next shape and kicks its rotation by 90°, eased through one of the M3 Expressive spatial spring cubic-bezier presets. The spring's overshoot is what produces the visible bounce at each morph boundary.
- a continuous linear background rotation on a wrapper
Motion tokens live in loading-indicator.animation.ts – the SCSS only
ships visual tokens (size, colour, ratio). Override motion globally via
provideMatExpLoadingIndicatorOptionsspeed input.
prefers-reduced-motion: reduce is honoured on every layer: the entry /
exit tweens short-circuit to event.animationComplete(), and the
rotation / morph timelines are skipped via gsap.matchMedia().
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| config | MatExpLoadingIndicatorConfig | undefined | 'default' | Visual configuration of the indicator.
|
| ariaLabel | string | undefined | 'Loading' | Accessible label announced by screen readers while the indicator is shown. |
| speed | MatExpLoadingIndicatorSpeed | 'default' | Speed preset for the shape morph and rotation animation. Each preset maps
to one of the M3 Expressive spatial spring tokens ( Changing this signal at runtime tears down the active GSAP timelines and re-builds them with the new spring, so the indicator stays in sync with the new motion language without recreating the component. |