Spinner
Lightweight loading indicator with accessible status text.
- Selector
- ui-spinner
- Package
- @ngnova/ui/spinner
Import
import { UiSpinnerComponent } from '@ngnova/ui/spinner';Usage & variants
Live examples use the public ui-spinner API, paired with the exact snippet a product team would paste into an Angular app.
Invoice loading status
Lightweight loading indicator with accessible status text.
Production guidance
Use these notes to decide when the component belongs in a product workflow and what to verify before shipping.
When to use
Use when work is ongoing but progress percentage is unknown.
Watch for
Prefer Progress Bar when actual progress is known.
Product recipes
Apply Spinner in distinct, copyable product scenarios—not just an isolated component state.
Accessible loading
Provide a label unless another element already announces loading.
1 2
<ui-spinner label="Loading invoices" />
<ui-spinner decorative />Loading table region
Combine a named status with the affected region so users understand which content is pending.
1 2 3 4
<section aria-busy="true" aria-labelledby="invoices-heading" class="grid place-items-center gap-3">
<h3 id="invoices-heading">Invoices</h3>
<ui-spinner label="Loading invoices" size="lg" />
</section>API Reference
Inputs and outputs are semver-sensitive public API. Keep examples aligned with this table.
Inputs
size 'md' 'sm' | 'md' | 'lg' Spinner diameter and border thickness.
label 'Loading' string Accessible loading label when the spinner is not decorative.
decorative false boolean Removes status semantics when another element already announces loading.
| Name | Type | Default | Description |
|---|---|---|---|
size | 'sm' | 'md' | 'lg' | 'md' | Spinner diameter and border thickness. |
label | string | 'Loading' | Accessible loading label when the spinner is not decorative. |
decorative | boolean | false | Removes status semantics when another element already announces loading. |
Accessibility
- Non-decorative spinners expose one polite status label; blank labels safely fall back to Loading.
- Decorative spinners are hidden from assistive technology.
- Rotation stops when the user prefers reduced motion while the status semantics remain available.
Keyboard behavior
- Spinner has no keyboard interaction.
Testing guidance
- Assert named status behavior, label fallback, all sizes, reduced-motion class, and decorative mode.
- No component harness is included because Spinner is non-interactive and exposes no state beyond its directly observable status semantics.