react-native-fabric-shimmer@0.1.0
Minor Changes
-
6b35aedThanks @tychota! - Initial public release.<Skeleton loading>wraps any component tree and paints animated bones at the exact positions of the real content, measured at runtime via Fabric's JSImeasureLayout. No build-time scan, no JSON pre-bake — the real component is the skeleton.What's in the box:
Skeleton— the wrapper. Visibility honours a delay-then-min-show pattern (delayShowDuration, default 100 ms) so fast loads never flash a skeleton; once mounted,minShowDurationkeeps it on screen long enough to avoid flicker. Three animations:shimmer(default),pulse,none. Fades in/out withtransition(default 300 ms). Container bones (cards with bg + border) render statically using the captured source styling; leaf bones (text, image, view) animate with a hairlinehighlightColoroutline.Bone— default bone renderer; override per-rect withrenderBone.defaultClassify—leaf/container/transparent/skipfrom fiber type + flattened style. Only host fibers (typeof fiber.type === "string") are classified — component fibers (forwardRefs like<Text>,<Image>) pass through to their host so measurement actually lands on a FabricstateNode.- IR helpers —
walk,find,findAll,hide,merge,unionforrefineBones. dumpTree— formats a measuredBoneNodetree as indented ASCII (type, classification, rect) for debugging custom classify/refine logic.
Requirements: React Native ≥ 0.76 with the New Architecture enabled (Fabric); React ≥ 19;
react-native-reanimated≥ 4;expo-linear-gradient≥ 15 (peer). React Compiler-safe. HonoursReduceMotion.System.120 tests across 22 files cover the IR helpers, fiber classification, measurement pipeline (
buildBoneTree→measureTree→flattenTree), visibility hooks, Bone + Skeleton element trees, anddumpTree. ESM 5.2 kB gzip / CJS 5.3 kB gzip viasize-limit. Reassure perf baseline at 10 and 30 bones.