BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Sora UI/lib-scroll-trigger-utils

Scroll Trigger Utils

sora-ui/lib-scroll-trigger-utils
FreeUtility

Shared GSAP ScrollTrigger helpers (window/scroller detection, ready/resize waiting) used by scroll-driven primitives.

Install it

npx shadcn@latest add https://ui.soralabs.io.vn/r/lib-scroll-trigger-utils.json

Source

registry/lib/scroll-trigger-utils/index.tsxui.soralabs.io.vn/r/lib-scroll-trigger-utils.json
1function isWindowScroller(scroller: Element | Window): boolean {
2 return (
3 scroller === window ||
4 scroller === document.documentElement ||
5 scroller === document.body
6 );
7}
8
9function waitForNextFrame(): Promise<void> {
10 return new Promise((resolve) => {
11 requestAnimationFrame(() => {
12 requestAnimationFrame(() => {
13 resolve();
14 });
15 });
16 });
17}
18
19async function waitForScrollerReady(
20 scroller: Element | Window,
21 scrollReadyEvent?: string
22): Promise<void> {
23 await waitForNextFrame();
24
25 if (!scrollReadyEvent || isWindowScroller(scroller)) {
26 if (!isWindowScroller(scroller)) {
27 await waitForNextFrame();
28 }
29 return;
30 }
31
32 await Promise.race([
33 new Promise<void>((resolve) => {
34 window.addEventListener(scrollReadyEvent, () => resolve(), {
35 once: true,
36 });
37 }),
38 new Promise<void>((resolve) => {
39 window.setTimeout(resolve, 300);
40 }),
41 ]);
42
43 await waitForNextFrame();
44}
45
46function observeWindowResize(onResize: () => void): () => void {
47 let frameId = 0;
48
49 const handleResize = () => {
50 cancelAnimationFrame(frameId);
51 frameId = requestAnimationFrame(onResize);
52 };
53
54 window.addEventListener("resize", handleResize);
55
56 return () => {
57 cancelAnimationFrame(frameId);
58 window.removeEventListener("resize", handleResize);
59 };
60}
61
62export {
63 isWindowScroller,
64 observeWindowResize,
65 waitForNextFrame,
66 waitForScrollerReady,
67};

Files it writes

  • registry/lib/scroll-trigger-utils/index.tsx

Facts

Registry
Sora UI
Type
registry:lib
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-12
Last confirmed
today

Go to the source

ui.soralabs.io.vn Raw registry item This item as JSON

More from Sora UI

All 97 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Ease & Spring Tokenslib-easeSora UIUtilitiesFreeno deps
getStrictContextlib-get-strict-contextSora UIUtilitiesFreeno deps
BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex