loading-state-zoo 0.2.0 → 0.3.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 +276 -3
- package/dist/index.cjs +270 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -3
- package/dist/index.d.ts +36 -3
- package/dist/index.js +268 -32
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +267 -31
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +123 -1
- package/dist/react.d.ts +123 -1
- package/dist/react.js +267 -31
- package/dist/react.js.map +1 -1
- package/dist/theme.css +451 -0
- package/docs/AI.md +16 -8
- package/docs/components.json +297 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# loading-state-zoo
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**32 loading patterns, one tiny package.** Dots, spinners, orbs, 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,33 @@ 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
|
+
| [Pulsing orb](#pulsing-orb) | Orbs | Ambient loads, hero panels, splash |
|
|
32
|
+
| [Morphing orb](#morphing-orb) | Orbs | Creative waits, brand moments |
|
|
33
|
+
| [Siri orb](#siri-orb) | Orbs | Voice assistants, AI thinking |
|
|
34
|
+
| [Dot orb](#dot-orb) | Orbs | Orbit waits, spatial loading |
|
|
35
|
+
| [Planet orb](#planet-orb) | Orbs | Space motifs, sci-fi waits |
|
|
36
|
+
| [Aura orb](#aura-orb) | Orbs | Gradient waits, brand palettes |
|
|
30
37
|
| [Eyes](#eyes) | Shape | Fun state, "watching" waiting |
|
|
31
38
|
| [Morphing square](#morphing-square) | Shape | Modern brand moments |
|
|
32
39
|
| [Breathing pulse](#breathing-pulse) | Shape | Subtle, gentle "alive" loading |
|
|
33
40
|
| [Equalizer](#equalizer) | Bars & rings | Music, audio, waveform |
|
|
34
41
|
| [Progress ring](#progress-ring) | Bars & rings | Showing exact percent done |
|
|
42
|
+
| [Progress bar](#progress-bar) | Bars & rings | Showing exact percent done, linear |
|
|
35
43
|
| [Indeterminate progress bar](#indeterminate-progress-bar) | Bars & rings | "Doing something, no % yet" bar |
|
|
44
|
+
| [Activity rings](#activity-rings) | Bars & rings | Fitness, health, Apple Watch style |
|
|
45
|
+
| [Waveform](#waveform) | Music | Audio apps, playing states |
|
|
46
|
+
| [Vinyl](#vinyl) | Music | Music apps, retro feels |
|
|
47
|
+
| [Sonar](#sonar) | Music | Audio pulses, location pings |
|
|
48
|
+
| [Music note](#music-note) | Music | Music players, playful waits |
|
|
36
49
|
| [Skeleton shimmer](#skeleton-shimmer) | Skeleton | Placeholder while real content loads |
|
|
50
|
+
| [Skeleton card](#skeleton-card) | Skeleton | Composite card/feed placeholders |
|
|
51
|
+
| [Skeleton list](#skeleton-list) | Skeleton | Chat/inbox/search list placeholders |
|
|
37
52
|
|
|
38
53
|
---
|
|
39
54
|
|
|
@@ -70,7 +85,7 @@ export function MyLoader() {
|
|
|
70
85
|
}
|
|
71
86
|
```
|
|
72
87
|
|
|
73
|
-
That's it. Importing the package **automatically registers** all
|
|
88
|
+
That's it. Importing the package **automatically registers** all 32 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
89
|
|
|
75
90
|
If you prefer to register manually:
|
|
76
91
|
|
|
@@ -98,7 +113,7 @@ Add the package from a CDN (or bundle it) and write the tags directly in your HT
|
|
|
98
113
|
</div>
|
|
99
114
|
```
|
|
100
115
|
|
|
101
|
-
Mix and match any of the
|
|
116
|
+
Mix and match any of the 32 tags — see the full list below.
|
|
102
117
|
|
|
103
118
|
---
|
|
104
119
|
|
|
@@ -222,6 +237,12 @@ Every number inside every animation is also a CSS variable. Change how far dots
|
|
|
222
237
|
| `--lz-eq-min` | Equalizer | Shortest bar height | `0.3` |
|
|
223
238
|
| `--lz-slide-from` | Indeterminate bar | Slider start position | `-100%` |
|
|
224
239
|
| `--lz-slide-to` | Indeterminate bar | Slider end position | `300%` |
|
|
240
|
+
| `--lz-orb-scale` | Pulsing orb | Peak breathe scale | `1.16` |
|
|
241
|
+
| `--lz-orb-fade` | Pulsing orb / dot orb | Mid-breathe opacity (dot orb rests at `0.14`) | `0.88` |
|
|
242
|
+
| `--lz-dot-min` | Dot orb | Resting dot scale | `0.7` |
|
|
243
|
+
| `--lz-wf-min` | Waveform | Resting bar scale | `0.22` |
|
|
244
|
+
| `--lz-sonar-fade` | Sonar | Ring start opacity | `0.9` |
|
|
245
|
+
| `--lz-note-bob` | Music note | Note bob height | `0.35em` |
|
|
225
246
|
|
|
226
247
|
---
|
|
227
248
|
|
|
@@ -323,6 +344,23 @@ Variables: `--lz-grid-gap` · `--lz-grid-min` · `--lz-grid-fade`.
|
|
|
323
344
|
|
|
324
345
|
---
|
|
325
346
|
|
|
347
|
+
### Ellipsis
|
|
348
|
+
|
|
349
|
+
**What it is:** three periods that appear in a typewriter rhythm. **Good for:** chat, messaging, text queues.
|
|
350
|
+
|
|
351
|
+
```html
|
|
352
|
+
<lz-ellipsis size="10" color="#0a84ff"></lz-ellipsis>
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
```tsx
|
|
356
|
+
<Ellipsis size={10} color="#0a84ff" />
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Attributes: `size` (default `8`) · `color` · `speed`.
|
|
360
|
+
Variables: `--lz-ellipsis-min` · `--lz-ellipsis-fade`.
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
326
364
|
### Arc spinner
|
|
327
365
|
|
|
328
366
|
**What it is:** one spinning "pac-man" ring. The classic. **Good for:** any circular wait.
|
|
@@ -408,6 +446,104 @@ Variables: `--lz-dot-size` · `--lz-orbit-fade`.
|
|
|
408
446
|
|
|
409
447
|
---
|
|
410
448
|
|
|
449
|
+
### Pulsing orb
|
|
450
|
+
|
|
451
|
+
**What it is:** a glowing gradient orb that breathes in and out. **Good for:** ambient loads, hero panels, app splash screens.
|
|
452
|
+
|
|
453
|
+
```html
|
|
454
|
+
<lz-pulsing-orb size="64" accent="#ff375f"></lz-pulsing-orb>
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
```tsx
|
|
458
|
+
<PulsingOrb size={64} accent="#ff375f" />
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
Attributes: `size` (default `44`) · `accent` (default `#0a84ff`) · `speed`.
|
|
462
|
+
Variables: `--lz-orb-scale` · `--lz-orb-fade`.
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
### Morphing orb
|
|
467
|
+
|
|
468
|
+
**What it is:** a blob that endlessly morphs its silhouette between rounded shapes. **Good for:** creative waits, brand moments, game loading.
|
|
469
|
+
|
|
470
|
+
```html
|
|
471
|
+
<lz-morphing-orb size="64" accent="#30d158"></lz-morphing-orb>
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
```tsx
|
|
475
|
+
<MorphingOrb size={64} accent="#30d158" />
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
Attributes: `size` (default `44`) · `accent` (default `#0a84ff`) · `speed`.
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
### Siri orb
|
|
483
|
+
|
|
484
|
+
**What it is:** a Siri-style orb with a multicolored sheen swirling inside a clipped circle. **Good for:** voice assistants, AI "thinking", smart waits.
|
|
485
|
+
|
|
486
|
+
```html
|
|
487
|
+
<lz-siri-orb size="72" accent="#64d2ff"></lz-siri-orb>
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
```tsx
|
|
491
|
+
<SiriOrb size={72} accent="#64d2ff" />
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
Attributes: `size` (default `44`) · `accent` (default `#0a84ff`) · `speed`.
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
### Dot orb
|
|
499
|
+
|
|
500
|
+
**What it is:** a ring of shimmering dots arranged into an orb silhouette. **Good for:** orbit waits, spatial loading, gaming screens.
|
|
501
|
+
|
|
502
|
+
```html
|
|
503
|
+
<lz-dot-orb count="12" color="#ff9f0a"></lz-dot-orb>
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
```tsx
|
|
507
|
+
<DotOrb count={12} color="#ff9f0a" />
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
Attributes: `size` (default `44`) · `count` (default `8`) · `color` · `speed`.
|
|
511
|
+
Variables: `--lz-dot-min` · `--lz-orb-fade`.
|
|
512
|
+
|
|
513
|
+
---
|
|
514
|
+
|
|
515
|
+
### Planet orb
|
|
516
|
+
|
|
517
|
+
**What it is:** a glowing planet core with small moons orbiting it. **Good for:** space motifs, science apps, sci-fi waits.
|
|
518
|
+
|
|
519
|
+
```html
|
|
520
|
+
<lz-planet-orb count="3" accent="#bf5af2" color="#64d2ff"></lz-planet-orb>
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
```tsx
|
|
524
|
+
<PlanetOrb count={3} accent="#bf5af2" color="#64d2ff" />
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
Attributes: `size` (default `44`) · `accent` (default `#0a84ff`) · `color` · `count` (moons, default `2`) · `speed`.
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
### Aura orb
|
|
532
|
+
|
|
533
|
+
**What it is:** two tinted orbs counter-rotating in overlapping orbits. **Good for:** gradient waits, brand palettes, hero backgrounds.
|
|
534
|
+
|
|
535
|
+
```html
|
|
536
|
+
<lz-aura-orb accent="#ff375f" color="#64d2ff"></lz-aura-orb>
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
```tsx
|
|
540
|
+
<AuraOrb accent="#ff375f" color="#64d2ff" />
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
Attributes: `size` (default `44`) · `accent` (default `#0a84ff`) · `color` · `speed`.
|
|
544
|
+
|
|
545
|
+
---
|
|
546
|
+
|
|
411
547
|
### Eyes
|
|
412
548
|
|
|
413
549
|
**What it is:** two cartoon eyes that look side to side and blink. **Good for:** fun apps, "watching" moments, kids' stuff.
|
|
@@ -495,6 +631,25 @@ Accessibility: it exposes `role="progressbar"` plus `aria-valuenow/min/max`, and
|
|
|
495
631
|
|
|
496
632
|
---
|
|
497
633
|
|
|
634
|
+
### Progress bar
|
|
635
|
+
|
|
636
|
+
**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.)*
|
|
637
|
+
|
|
638
|
+
```html
|
|
639
|
+
<lz-progress-bar width="220" height="8" percent="60" color="#0a84ff" track-color="rgba(255,255,255,0.15)"></lz-progress-bar>
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
```tsx
|
|
643
|
+
<ProgressBar width={220} height={8} percent={60} color="#0a84ff" trackColor="rgba(255,255,255,0.15)" />
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
Attributes: `width` (default `160`) · `height` (default `6`) · `percent` (default `0`) · `color` (fill) · `track-color` · `speed`.
|
|
647
|
+
Variables: `--lz-track`.
|
|
648
|
+
|
|
649
|
+
Accessibility: it exposes `role="progressbar"` plus `aria-valuenow/min/max`, and updates them when `percent` changes.
|
|
650
|
+
|
|
651
|
+
---
|
|
652
|
+
|
|
498
653
|
### Indeterminate progress bar
|
|
499
654
|
|
|
500
655
|
**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 +667,90 @@ Variables: `--lz-accent` · `--lz-surface` · `--lz-slide-from` · `--lz-slide-t
|
|
|
512
667
|
|
|
513
668
|
---
|
|
514
669
|
|
|
670
|
+
### Activity rings
|
|
671
|
+
|
|
672
|
+
**What it is:** three Apple Watch-style activity rings spinning at different speeds and directions. **Good for:** fitness apps, health dashboards, workout sync.
|
|
673
|
+
|
|
674
|
+
```html
|
|
675
|
+
<lz-activity-rings size="64"></lz-activity-rings>
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
```tsx
|
|
679
|
+
<ActivityRings size={64} />
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
Attributes: `size` (default `44`) · `accent` (outer, default `#fa114f`) · `color` (middle, default `#30d158`) · `color-weak` (inner, default `#32d7ff`) · `speed`.
|
|
683
|
+
Variables: `--lz-accent` · `--lz-color` · `--lz-color-weak`.
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
### Waveform
|
|
688
|
+
|
|
689
|
+
**What it is:** a mirrored audio waveform pulsing around a center line. **Good for:** audio apps, playing states, podcast waits.
|
|
690
|
+
|
|
691
|
+
```html
|
|
692
|
+
<lz-waveform count="15" accent="#bf5af2"></lz-waveform>
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
```tsx
|
|
696
|
+
<Waveform count={15} accent="#bf5af2" />
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
Attributes: `size` (height, default `32`) · `count` (bars, default `11`) · `color` · `accent` · `bar-width` (default `4`) · `gap` (default `4`) · `speed`.
|
|
700
|
+
Variables: `--lz-bar-width` · `--lz-gap` · `--lz-wf-min`.
|
|
701
|
+
|
|
702
|
+
---
|
|
703
|
+
|
|
704
|
+
### Vinyl
|
|
705
|
+
|
|
706
|
+
**What it is:** a spinning record with a gently bobbing tonearm. **Good for:** music apps, retro waits, album screens.
|
|
707
|
+
|
|
708
|
+
```html
|
|
709
|
+
<lz-vinyl accent="#fa114f"></lz-vinyl>
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
```tsx
|
|
713
|
+
<Vinyl accent="#fa114f" />
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
Attributes: `size` (default `48`) · `accent` (label/stylus, default `#0a84ff`) · `color` (tonearm) · `speed`.
|
|
717
|
+
|
|
718
|
+
---
|
|
719
|
+
|
|
720
|
+
### Sonar
|
|
721
|
+
|
|
722
|
+
**What it is:** a pulsing core emitting expanding sonar rings. **Good for:** audio pulses, location pings, motion waits.
|
|
723
|
+
|
|
724
|
+
```html
|
|
725
|
+
<lz-sonar count="4" accent="#30d158"></lz-sonar>
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
```tsx
|
|
729
|
+
<Sonar count={4} accent="#30d158" />
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
Attributes: `size` (default `44`) · `count` (rings, default `3`) · `accent` (ring color) · `color` (core) · `speed`.
|
|
733
|
+
Variables: `--lz-sonar-fade`.
|
|
734
|
+
|
|
735
|
+
---
|
|
736
|
+
|
|
737
|
+
### Music note
|
|
738
|
+
|
|
739
|
+
**What it is:** musical note glyphs bobbing in a sing-song rhythm. **Good for:** music players, karaoke, playful waits.
|
|
740
|
+
|
|
741
|
+
```html
|
|
742
|
+
<lz-music-note count="3" color="#bf5af2"></lz-music-note>
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
```tsx
|
|
746
|
+
<MusicNote count={3} color="#bf5af2" />
|
|
747
|
+
```
|
|
748
|
+
|
|
749
|
+
Attributes: `size` (default `32`) · `count` (notes, default `2`) · `color` · `speed`.
|
|
750
|
+
Variables: `--lz-note-bob`.
|
|
751
|
+
|
|
752
|
+
---
|
|
753
|
+
|
|
515
754
|
### Skeleton shimmer
|
|
516
755
|
|
|
517
756
|
**What it is:** a rounded block with a light that sweeps across. **Good for:** placeholders while real content loads (images, profiles, cards).
|
|
@@ -529,6 +768,40 @@ Variables: `--lz-surface` · `--lz-sheen` (sweep light color) · `--lz-radius`
|
|
|
529
768
|
|
|
530
769
|
---
|
|
531
770
|
|
|
771
|
+
### Skeleton card
|
|
772
|
+
|
|
773
|
+
**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.
|
|
774
|
+
|
|
775
|
+
```html
|
|
776
|
+
<lz-skeleton-card width="240" height="72"></lz-skeleton-card>
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
```tsx
|
|
780
|
+
<SkeletonCard width={240} height={72} />
|
|
781
|
+
```
|
|
782
|
+
|
|
783
|
+
Attributes: `width` (default `200`) · `height` (default `64`) · `track-color` · `speed`.
|
|
784
|
+
Variables: `--lz-surface` · `--lz-radius` · `--lz-sheen-from` · `--lz-sheen-to`.
|
|
785
|
+
|
|
786
|
+
---
|
|
787
|
+
|
|
788
|
+
### Skeleton list
|
|
789
|
+
|
|
790
|
+
**What it is:** repeated list rows with avatars and text lines under one shared sheen. **Good for:** chat lists, inbox rows, search results.
|
|
791
|
+
|
|
792
|
+
```html
|
|
793
|
+
<lz-skeleton-list width="220" rows="5"></lz-skeleton-list>
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
```tsx
|
|
797
|
+
<SkeletonList width={220} rows={5} />
|
|
798
|
+
```
|
|
799
|
+
|
|
800
|
+
Attributes: `width` (default `180`) · `rows` (default `4`) · `track-color` · `speed`.
|
|
801
|
+
Variables: `--lz-surface` · `--lz-radius` · `--lz-sheen-from` · `--lz-sheen-to`.
|
|
802
|
+
|
|
803
|
+
---
|
|
804
|
+
|
|
532
805
|
## Accessibility
|
|
533
806
|
|
|
534
807
|
- Every pattern is announced to screen readers: dots/spinners/bars use `role="status"` with `aria-label="Loading"`.
|