Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

fix: gave the hypertext animation to start when in View (#452)

Arghya Das6f9781ceca1f
diff --git a/registry/default/magicui/hyper-text.tsx b/registry/default/magicui/hyper-text.tsx
index 0ac42eca..ec78d669 100644
--- a/registry/default/magicui/hyper-text.tsx
+++ b/registry/default/magicui/hyper-text.tsx
@@ -78,7 +78,7 @@ export default function HyperText({
observer.disconnect();
}
},
- { threshold: 0.1 },
+ { threshold: 0.1, rootMargin: "-30% 0px -30% 0px" },
);
if (elementRef.current) {
@@ -123,7 +123,7 @@ export default function HyperText({
onMouseEnter={handleAnimationTrigger}
{...props}
>
- <AnimatePresence mode="wait">
+ <AnimatePresence>
{displayText.map((letter, index) => (
<motion.span
key={index}