Angular 加载指示器与遮罩层 | ng-hub-ui-loading

Angular 加载组件,提供 spinner、dots、bars、pulse、ring 五种指示器,支持 inline、overlay 与 fullscreen 三种模式,并附带用于全应用阻塞遮罩的服务。

样式

混入与样式

Override the `--hub-loading-*` design tokens in a single include. Every parameter is OPTIONAL and defaults to `null`: only the parameters you pass are emitted, so a theme that cares about the accent alone does not freeze the other ten tokens at today's defaults. Token-based and self-contained (no Bootstrap dependencies).

hub-loading-theme()
混入参数描述
Theming
hub-loading-theme()
$accent--hub-loading-accent
$size--hub-loading-size
$thickness--hub-loading-thickness
$speed--hub-loading-speed
$gap--hub-loading-gap
$text-color--hub-loading-text-color
$font-size--hub-loading-font-size
$backdrop-bg--hub-loading-backdrop-bg
$backdrop-blur--hub-loading-backdrop-blur
$z-index--hub-loading-z-index
$image-size--hub-loading-image-size
One-call theming for `<hub-loading>`

CSS 变量

用 11 个 CSS 变量为每一个像素设置主题。在 :root 处覆盖它们,或将其限定到某个容器范围内。

Loading

Design tokens read by this component. Override them on the host element (or any ancestor) to customize; every default falls back to the ng-hub-ui-ds layer.

变量默认值类型描述
--hub-loading-accentvar(--hub-sys-color-primary, #0d6efd)color Indicator colour, shared by all five variants
--hub-loading-size2.5remlength Indicator diameter; the sm / lg modifiers re-declare it
--hub-loading-thicknesscalc(var(--hub-ref-border-width, 1px) * 3)string Stroke weight of the spinner and ring variants
--hub-loading-speed0.9sstring Period of one animation loop, for every variant
--hub-loading-gapvar(--hub-sys-gap-2, var(--hub-ref-space-2, 0.5rem))length Space between indicator, message and projected content
--hub-loading-text-colorvar(--hub-sys-text-primary, var(--hub-ref-color-gray-900, #212529))color Message colour
--hub-loading-font-sizevar(--hub-ref-font-size-sm, 0.875rem)length Message font size; the sm / lg modifiers re-declare it
--hub-loading-backdrop-bgcolor-mix(in srgb, var(--hub-sys-surface-page, #ffffff) 72%, transparent)color Scrim painted behind the overlay and fullscreen modes
--hub-loading-backdrop-blur2pxlength Blur radius applied to whatever the scrim covers
--hub-loading-z-indexvar(--hub-sys-zindex-modal, 1055)number Stacking order of the fullscreen overlay
--hub-loading-image-sizevar(--hub-loading-size)length Size of the branding image supplied through image