loading-state-zoo 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +244 -4
- package/dist/index.cjs +337 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -3
- package/dist/index.d.ts +30 -3
- package/dist/index.js +336 -39
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +334 -37
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +113 -1
- package/dist/react.d.ts +113 -1
- package/dist/react.js +334 -37
- package/dist/react.js.map +1 -1
- package/dist/theme.css +555 -7
- package/docs/AI.md +19 -9
- package/docs/components.json +259 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# loading-state-zoo
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**30 loading patterns, one tiny package.** Dots, spinners, orbs, AI, shapes, bars, music and skeletons that tell the user "please wait" — made silky smooth and ready to use in **React**, **plain websites**, and **iOS / Android apps**.
|
|
4
4
|
|
|
5
5
|
Think of it as a small zoo of loading animals. You pick an animal, put it in your app's cage, and it starts moving right away. You can even change its **color**, **size** and **speed** — no scissors or glue required.
|
|
6
6
|
|
|
@@ -22,18 +22,31 @@ Think of it as a small zoo of loading animals. You pick an animal, put it in you
|
|
|
22
22
|
| [Wave dots](#wave-dots) | Dots | Waiting for a refresh or sync |
|
|
23
23
|
| [Helix dots](#helix-dots) | Dots | Data processing, fun & playful |
|
|
24
24
|
| [Dot grid wave](#dot-grid-wave) | Dots | Brick/grid placeholders, dashboards |
|
|
25
|
+
| [Ellipsis](#ellipsis) | Dots | Chat, messaging, "hold on" moments |
|
|
25
26
|
| [Arc spinner](#arc-spinner) | Spinner | Classic circular loading |
|
|
26
27
|
| [Material double arc](#material-double-arc) | Spinner | Android/Material look and feel |
|
|
27
28
|
| [Scan sweep](#scan-sweep) | Spinner | Radar/sonar, scanning, searching |
|
|
28
29
|
| [Orbit dots](#orbit-dots) | Spinner | Floaty, lightweight loading |
|
|
29
30
|
| [Orbit ring dots](#orbit-ring-dots) | Spinner | Cosmetic ring, data-heavy load |
|
|
31
|
+
| [Sonar](#sonar) | Spinner | Radar pings, location detection |
|
|
32
|
+
| [iOS 27 orb](#ios-27-orb) | Orbs | Voice assistants, AI thinking, holographic waits |
|
|
33
|
+
| [AI orb](#ai-orb) | AI | AI assistants, generative waits |
|
|
34
|
+
| [AI thinking](#ai-thinking) | AI | Chat completions, waiting on answers |
|
|
35
|
+
| [AI neural](#ai-neural) | AI | Neural nets, model training |
|
|
30
36
|
| [Eyes](#eyes) | Shape | Fun state, "watching" waiting |
|
|
31
37
|
| [Morphing square](#morphing-square) | Shape | Modern brand moments |
|
|
32
38
|
| [Breathing pulse](#breathing-pulse) | Shape | Subtle, gentle "alive" loading |
|
|
33
39
|
| [Equalizer](#equalizer) | Bars & rings | Music, audio, waveform |
|
|
34
40
|
| [Progress ring](#progress-ring) | Bars & rings | Showing exact percent done |
|
|
41
|
+
| [Progress bar](#progress-bar) | Bars & rings | Showing exact percent done, linear |
|
|
35
42
|
| [Indeterminate progress bar](#indeterminate-progress-bar) | Bars & rings | "Doing something, no % yet" bar |
|
|
43
|
+
| [Activity rings](#activity-rings) | Bars & rings | Fitness, health, Apple Watch style |
|
|
44
|
+
| [Waveform](#waveform) | Music | Audio apps, playing states |
|
|
45
|
+
| [Vinyl](#vinyl) | Music | Music apps, retro feels |
|
|
46
|
+
| [Music note](#music-note) | Music | Music players, playful waits |
|
|
36
47
|
| [Skeleton shimmer](#skeleton-shimmer) | Skeleton | Placeholder while real content loads |
|
|
48
|
+
| [Skeleton card](#skeleton-card) | Skeleton | Composite card/feed placeholders |
|
|
49
|
+
| [Skeleton list](#skeleton-list) | Skeleton | Chat/inbox/search list placeholders |
|
|
37
50
|
|
|
38
51
|
---
|
|
39
52
|
|
|
@@ -70,7 +83,7 @@ export function MyLoader() {
|
|
|
70
83
|
}
|
|
71
84
|
```
|
|
72
85
|
|
|
73
|
-
That's it. Importing the package **automatically registers** all
|
|
86
|
+
That's it. Importing the package **automatically registers** all 30 elements for you (it's safe to import in many places — duplicates are skipped). It is also safe on the server (SSR/Next.js): on Node there is no browser, so nothing registers and nothing breaks.
|
|
74
87
|
|
|
75
88
|
If you prefer to register manually:
|
|
76
89
|
|
|
@@ -98,7 +111,7 @@ Add the package from a CDN (or bundle it) and write the tags directly in your HT
|
|
|
98
111
|
</div>
|
|
99
112
|
```
|
|
100
113
|
|
|
101
|
-
Mix and match any of the
|
|
114
|
+
Mix and match any of the 30 tags — see the full list below.
|
|
102
115
|
|
|
103
116
|
---
|
|
104
117
|
|
|
@@ -222,6 +235,12 @@ Every number inside every animation is also a CSS variable. Change how far dots
|
|
|
222
235
|
| `--lz-eq-min` | Equalizer | Shortest bar height | `0.3` |
|
|
223
236
|
| `--lz-slide-from` | Indeterminate bar | Slider start position | `-100%` |
|
|
224
237
|
| `--lz-slide-to` | Indeterminate bar | Slider end position | `300%` |
|
|
238
|
+
| `--lz-ios-fade` | iOS 27 orb | Resting dot opacity | `0.2` |
|
|
239
|
+
| `--lz-ios-min` | iOS 27 orb | Resting dot scale | `0.5` |
|
|
240
|
+
| `--lz-ios-peak` | iOS 27 orb | Glowing dot scale | `1.25` |
|
|
241
|
+
| `--lz-wf-min` | Waveform | Resting bar scale | `0.22` |
|
|
242
|
+
| `--lz-sonar-fade` | Sonar | Ring start opacity | `0.9` |
|
|
243
|
+
| `--lz-note-bob` | Music note | Note bob height | `0.35em` |
|
|
225
244
|
|
|
226
245
|
---
|
|
227
246
|
|
|
@@ -323,6 +342,23 @@ Variables: `--lz-grid-gap` · `--lz-grid-min` · `--lz-grid-fade`.
|
|
|
323
342
|
|
|
324
343
|
---
|
|
325
344
|
|
|
345
|
+
### Ellipsis
|
|
346
|
+
|
|
347
|
+
**What it is:** three periods that appear in a typewriter rhythm. **Good for:** chat, messaging, text queues.
|
|
348
|
+
|
|
349
|
+
```html
|
|
350
|
+
<lz-ellipsis size="10" color="#0a84ff"></lz-ellipsis>
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
```tsx
|
|
354
|
+
<Ellipsis size={10} color="#0a84ff" />
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
Attributes: `size` (default `8`) · `color` · `speed`.
|
|
358
|
+
Variables: `--lz-ellipsis-min` · `--lz-ellipsis-fade`.
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
326
362
|
### Arc spinner
|
|
327
363
|
|
|
328
364
|
**What it is:** one spinning "pac-man" ring. The classic. **Good for:** any circular wait.
|
|
@@ -359,7 +395,7 @@ Variables: `--lz-stroke` · `--lz-color-weak`.
|
|
|
359
395
|
|
|
360
396
|
### Scan sweep
|
|
361
397
|
|
|
362
|
-
**What it is:** concentric rings with a sweeping beam — like radar. **Good for:** scanning, searching, syncing data.
|
|
398
|
+
**What it is:** concentric rings with crosshair ticks, a counter-rotating dial and a sweeping beam — like a radar. **Good for:** scanning, searching, syncing data.
|
|
363
399
|
|
|
364
400
|
```html
|
|
365
401
|
<lz-scan-sweep size="64" color="#30d158"></lz-scan-sweep>
|
|
@@ -408,6 +444,73 @@ Variables: `--lz-dot-size` · `--lz-orbit-fade`.
|
|
|
408
444
|
|
|
409
445
|
---
|
|
410
446
|
|
|
447
|
+
### iOS 27 orb
|
|
448
|
+
|
|
449
|
+
**What it is:** an orb of 27 dots where a bright glow travels from the dot being "touched" to the next, spiraling inward like an iOS listening animation. **Good for:** voice assistants, AI thinking, holographic waits.
|
|
450
|
+
|
|
451
|
+
```html
|
|
452
|
+
<lz-ios-27-orb size="64" accent="#64d2ff" color="#bf5af2"></lz-ios-27-orb>
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
```tsx
|
|
456
|
+
<Ios27Orb size={64} accent="#64d2ff" color="#bf5af2" />
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
Attributes: `size` (default `44`) · `accent` (warm pole hue, default `#0a84ff`) · `color` (cool pole hue, default `#f5f5f7`) · `speed`.
|
|
460
|
+
Variables: `--lz-ios-fade` · `--lz-ios-min` · `--lz-ios-peak`.
|
|
461
|
+
|
|
462
|
+
---
|
|
463
|
+
|
|
464
|
+
### AI orb
|
|
465
|
+
|
|
466
|
+
**What it is:** a breathing gradient sphere with an orbiting light dot and twinkling sparkles. **Good for:** AI assistants, generative waits, "smart" ready states.
|
|
467
|
+
|
|
468
|
+
```html
|
|
469
|
+
<lz-ai-orb size="64" accent="#bf5af2"></lz-ai-orb>
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
```tsx
|
|
473
|
+
<AiOrb size={64} accent="#bf5af2" />
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
Attributes: `size` (default `44`) · `accent` (default `#0a84ff`) · `color` (sparkles) · `speed`.
|
|
477
|
+
|
|
478
|
+
---
|
|
479
|
+
|
|
480
|
+
### AI thinking
|
|
481
|
+
|
|
482
|
+
**What it is:** a rounded thinking field with typing dots wrapped in a rotating accent ring. **Good for:** chat completions, AI replies, waiting on answers.
|
|
483
|
+
|
|
484
|
+
```html
|
|
485
|
+
<lz-ai-thinking size="44" accent="#30d158"></lz-ai-thinking>
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
```tsx
|
|
489
|
+
<AiThinking size={44} accent="#30d158" />
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
Attributes: `size` (default `40`) · `accent` (default `#0a84ff`) · `color` (typing dots) · `speed`.
|
|
493
|
+
Variables: `--lz-surface` (field background).
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
### AI neural
|
|
498
|
+
|
|
499
|
+
**What it is:** a grid of dots pulsing like an artificial neural network with a diagonal activation wave. **Good for:** neural nets, model training, data pipelines.
|
|
500
|
+
|
|
501
|
+
```html
|
|
502
|
+
<lz-ai-neural rows="4" cols="7" accent="#fa114f"></lz-ai-neural>
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
```tsx
|
|
506
|
+
<AiNeural rows={4} cols={7} accent="#fa114f" />
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
Attributes: `size` (default `6`) · `rows` (default `3`) · `cols` (default `5`) · `gap` (default `10`) · `accent` (checking neurons) · `color` (resting neurons) · `speed`.
|
|
510
|
+
Variables: `--lz-grid-gap` · `--lz-grid-min` · `--lz-grid-fade`.
|
|
511
|
+
|
|
512
|
+
---
|
|
513
|
+
|
|
411
514
|
### Eyes
|
|
412
515
|
|
|
413
516
|
**What it is:** two cartoon eyes that look side to side and blink. **Good for:** fun apps, "watching" moments, kids' stuff.
|
|
@@ -495,6 +598,25 @@ Accessibility: it exposes `role="progressbar"` plus `aria-valuenow/min/max`, and
|
|
|
495
598
|
|
|
496
599
|
---
|
|
497
600
|
|
|
601
|
+
### Progress bar
|
|
602
|
+
|
|
603
|
+
**What it is:** a linear bar that fills to a percentage. **Good for:** uploads, downloads, tasks with a known percent. *(Not animated by itself — you drive it with the `percent` attribute.)*
|
|
604
|
+
|
|
605
|
+
```html
|
|
606
|
+
<lz-progress-bar width="220" height="8" percent="60" color="#0a84ff" track-color="rgba(255,255,255,0.15)"></lz-progress-bar>
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
```tsx
|
|
610
|
+
<ProgressBar width={220} height={8} percent={60} color="#0a84ff" trackColor="rgba(255,255,255,0.15)" />
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
Attributes: `width` (default `160`) · `height` (default `6`) · `percent` (default `0`) · `color` (fill) · `track-color` · `speed`.
|
|
614
|
+
Variables: `--lz-track`.
|
|
615
|
+
|
|
616
|
+
Accessibility: it exposes `role="progressbar"` plus `aria-valuenow/min/max`, and updates them when `percent` changes.
|
|
617
|
+
|
|
618
|
+
---
|
|
619
|
+
|
|
498
620
|
### Indeterminate progress bar
|
|
499
621
|
|
|
500
622
|
**What it is:** a bar with a slider that slides back and forth. Classic "we're working on it". **Good for:** long unknown tasks.
|
|
@@ -512,6 +634,90 @@ Variables: `--lz-accent` · `--lz-surface` · `--lz-slide-from` · `--lz-slide-t
|
|
|
512
634
|
|
|
513
635
|
---
|
|
514
636
|
|
|
637
|
+
### Activity rings
|
|
638
|
+
|
|
639
|
+
**What it is:** three Apple Watch-style activity rings spinning at different speeds and directions. **Good for:** fitness apps, health dashboards, workout sync.
|
|
640
|
+
|
|
641
|
+
```html
|
|
642
|
+
<lz-activity-rings size="64"></lz-activity-rings>
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
```tsx
|
|
646
|
+
<ActivityRings size={64} />
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
Attributes: `size` (default `44`) · `accent` (outer, default `#fa114f`) · `color` (middle, default `#30d158`) · `color-weak` (inner, default `#32d7ff`) · `speed`.
|
|
650
|
+
Variables: `--lz-accent` · `--lz-color` · `--lz-color-weak`.
|
|
651
|
+
|
|
652
|
+
---
|
|
653
|
+
|
|
654
|
+
### Waveform
|
|
655
|
+
|
|
656
|
+
**What it is:** a mirrored audio waveform pulsing around a center line. **Good for:** audio apps, playing states, podcast waits.
|
|
657
|
+
|
|
658
|
+
```html
|
|
659
|
+
<lz-waveform count="15" accent="#bf5af2"></lz-waveform>
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
```tsx
|
|
663
|
+
<Waveform count={15} accent="#bf5af2" />
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
Attributes: `size` (height, default `32`) · `count` (bars, default `11`) · `color` · `accent` · `bar-width` (default `4`) · `gap` (default `4`) · `speed`.
|
|
667
|
+
Variables: `--lz-bar-width` · `--lz-gap` · `--lz-wf-min`.
|
|
668
|
+
|
|
669
|
+
---
|
|
670
|
+
|
|
671
|
+
### Vinyl
|
|
672
|
+
|
|
673
|
+
**What it is:** a spinning record with a light sheen, label, spindle and a gently bobbing tonearm. **Good for:** music apps, retro waits, album screens.
|
|
674
|
+
|
|
675
|
+
```html
|
|
676
|
+
<lz-vinyl accent="#fa114f"></lz-vinyl>
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
```tsx
|
|
680
|
+
<Vinyl accent="#fa114f" />
|
|
681
|
+
```
|
|
682
|
+
|
|
683
|
+
Attributes: `size` (default `48`) · `accent` (label/stylus, default `#0a84ff`) · `color` (tonearm) · `speed`.
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
### Sonar
|
|
688
|
+
|
|
689
|
+
**What it is:** a pulsing core emitting expanding sonar rings. **Good for:** radar pings, location detection, motion waits.
|
|
690
|
+
|
|
691
|
+
```html
|
|
692
|
+
<lz-sonar count="4" accent="#30d158"></lz-sonar>
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
```tsx
|
|
696
|
+
<Sonar count={4} accent="#30d158" />
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
Attributes: `size` (default `44`) · `count` (rings, default `3`) · `accent` (ring color) · `color` (core) · `speed`.
|
|
700
|
+
Variables: `--lz-sonar-fade`.
|
|
701
|
+
|
|
702
|
+
---
|
|
703
|
+
|
|
704
|
+
### Music note
|
|
705
|
+
|
|
706
|
+
**What it is:** drawn musical notes with heads, stems and flags bobbing in a sing-song rhythm. **Good for:** music players, karaoke, playful waits.
|
|
707
|
+
|
|
708
|
+
```html
|
|
709
|
+
<lz-music-note count="3" color="#bf5af2"></lz-music-note>
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
```tsx
|
|
713
|
+
<MusicNote count={3} color="#bf5af2" />
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
Attributes: `size` (default `32`) · `count` (notes, default `2`) · `color` · `speed`.
|
|
717
|
+
Variables: `--lz-note-bob`.
|
|
718
|
+
|
|
719
|
+
---
|
|
720
|
+
|
|
515
721
|
### Skeleton shimmer
|
|
516
722
|
|
|
517
723
|
**What it is:** a rounded block with a light that sweeps across. **Good for:** placeholders while real content loads (images, profiles, cards).
|
|
@@ -529,6 +735,40 @@ Variables: `--lz-surface` · `--lz-sheen` (sweep light color) · `--lz-radius`
|
|
|
529
735
|
|
|
530
736
|
---
|
|
531
737
|
|
|
738
|
+
### Skeleton card
|
|
739
|
+
|
|
740
|
+
**What it is:** a composite card skeleton with an avatar circle and text lines under one shared sheen. **Good for:** profile cards, feed items, user rows.
|
|
741
|
+
|
|
742
|
+
```html
|
|
743
|
+
<lz-skeleton-card width="240" height="72"></lz-skeleton-card>
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
```tsx
|
|
747
|
+
<SkeletonCard width={240} height={72} />
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
Attributes: `width` (default `200`) · `height` (default `64`) · `track-color` · `speed`.
|
|
751
|
+
Variables: `--lz-surface` · `--lz-radius` · `--lz-sheen-from` · `--lz-sheen-to`.
|
|
752
|
+
|
|
753
|
+
---
|
|
754
|
+
|
|
755
|
+
### Skeleton list
|
|
756
|
+
|
|
757
|
+
**What it is:** repeated list rows with avatars and text lines under one shared sheen. **Good for:** chat lists, inbox rows, search results.
|
|
758
|
+
|
|
759
|
+
```html
|
|
760
|
+
<lz-skeleton-list width="220" rows="5"></lz-skeleton-list>
|
|
761
|
+
```
|
|
762
|
+
|
|
763
|
+
```tsx
|
|
764
|
+
<SkeletonList width={220} rows={5} />
|
|
765
|
+
```
|
|
766
|
+
|
|
767
|
+
Attributes: `width` (default `180`) · `rows` (default `4`) · `track-color` · `speed`.
|
|
768
|
+
Variables: `--lz-surface` · `--lz-radius` · `--lz-sheen-from` · `--lz-sheen-to`.
|
|
769
|
+
|
|
770
|
+
---
|
|
771
|
+
|
|
532
772
|
## Accessibility
|
|
533
773
|
|
|
534
774
|
- Every pattern is announced to screen readers: dots/spinners/bars use `role="status"` with `aria-label="Loading"`.
|