A maintained framework-agnostic loading toolkit for modern web applications, with polished variants, smart anti-flicker behavior, accessible defaults, and a documentation site with a live playground.
Documentation & Playground | npm | Issues | Repository
Latest version: 0.1.1
Most loading packages stop at a basic spinner. Real products need more:
- multiple visual styles for cards, buttons, dashboards, tables, modals, and fullscreen states
- anti-flicker behavior so fast requests do not flash awkwardly
- accessible defaults with labels,
role="status",aria-live, and reduced-motion support - themeability through CSS variables without bringing a framework wrapper into the core package
@stackline/loading is built as a DOM-first TypeScript library that stays focused on the core runtime, so future framework wrappers can stay thin and consistent.
| Feature | Supported |
|---|---|
| TypeScript-first core library | ✅ |
| Framework-agnostic DOM runtime | ✅ |
| ESM + CJS + bundled types | ✅ |
| 35 built-in loading variants | ✅ |
| Spinner, dots, bars, shimmer, skeleton, geometric, sports, and cosmic styles | ✅ |
| Overlay, fullscreen, inline, and centered modes | ✅ |
| Delay before show | ✅ |
| Minimum visible duration | ✅ |
| Mount, unmount, show, hide, toggle, and destroy lifecycle | ✅ |
Accessible labels and aria-live support |
✅ |
| Reduced-motion support | ✅ |
| CSS variable theming | ✅ |
| Documentation site with live playground | ✅ |
| Variant CSS injected on demand | ✅ |
- Installation
- Quick Start
- API Overview
- Built-in Variants
- Smart Loading Behavior
- Accessibility and Theming
- Documentation and Playground
- Run Locally
- License
npm install @stackline/loadingimport { createLoader } from '@stackline/loading';
const panel = document.querySelector('.analytics-panel');
const loader = createLoader({
variant: 'orbit',
size: 48,
color: '#2563eb',
overlay: true,
centered: true,
delay: 150,
minVisible: 280,
label: 'Loading analytics'
});
loader.mount(panel);
loader.show();
try {
await loadAnalytics();
} finally {
await loader.hide();
loader.destroy();
}The library is centered around a small public API:
import {
createLoader,
hideLoader,
hydrateLoaders,
mountLoader,
showLoader
} from '@stackline/loading';Core runtime capabilities:
createLoader(options)creates a typed loader instanceloader.mount(target)mounts into a container or fullscreen targetloader.show()andloader.hide()respectdelayandminVisibleloader.update()lets you change variant, colors, sizing, or mode at runtimeloader.destroy()removes the instance cleanlyhydrateLoaders()enables declarative DOM usage throughdata-*attributes
The package currently ships 35 variants:
ring,dual-ring,segmented-ring,arc,orbit,comet,halo,radarastronaut,astronaut-to-mars,baseball-player,football-player,galaxypulse,wave-dots,bouncing-dots,typing-dots,grid-pulse,magnetic-dots,spiral-dots,constellationequalizer-bars,rising-barsshimmer,scan-line,liquid-pill,ripple-stack,minimal-spinner,neon-spinner,glass-spinnervortex,cube,diamond,prism,skeleton-blocks
The toolkit is designed for real application behavior, not just decoration.
delayprevents flashing loaders for very fast requestsminVisibleavoids abrupt hide/show flicker once the loader appearsoverlay,fullscreen,inline, andcenteredcover common product layouts- runtime mounting makes it easy to load cards, sections, buttons, tables, modals, and full pages
Example:
const loader = createLoader({
variant: 'ring',
delay: 180,
minVisible: 320,
overlay: true,
centered: true,
label: 'Syncing dashboard'
});Accessibility is part of the default behavior:
role="status"andaria-livesupport- optional visible labels
label: ''for compact cases where visible text should be removed- reduced-motion support via
prefers-reduced-motion
Theming is handled with CSS variables and exported theme tokens, so branded overrides stay straightforward.
The docs site includes:
- installation and quick start guides
- API reference
- variants gallery
- theming and accessibility guides
- overlay, button, fullscreen, and container loading examples
- delay and minimum visibility guidance
- a live playground for variant, size, speed, color, and behavior testing
Docs: https://alexandroit.github.io/loading/
npm install
npm run devProduction build:
npm run buildVerification:
npm run typecheck
npm testMIT