Skip to content

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

fix: update hypertext to use span

Dillion Verma0f2897351800
diff --git a/registry/default/magicui/hyper-text.tsx b/registry/default/magicui/hyper-text.tsx
index e50bc43d..d77d24a6 100644
--- a/registry/default/magicui/hyper-text.tsx
+++ b/registry/default/magicui/hyper-text.tsx
@@ -1,7 +1,7 @@
"use client";
-import { useEffect, useRef, useState } from "react";
import { AnimatePresence, motion, Variants } from "framer-motion";
+import { useEffect, useRef, useState } from "react";
import { cn } from "@/lib/utils";
@@ -53,8 +53,8 @@ export default function HyperText({
? l
: i <= interations.current
? text[i]
- : alphabets[getRandomInt(26)],
- ),
+ : alphabets[getRandomInt(26)]
+ )
);
interations.current = interations.current + 0.1;
} else {
@@ -62,7 +62,7 @@ export default function HyperText({
clearInterval(interval);
}
},
- duration / (text.length * 10),
+ duration / (text.length * 10)
);
// Clean up interval on unmount
return () => clearInterval(interval);
@@ -70,18 +70,18 @@ export default function HyperText({
return (
<div
- className="overflow-hidden py-2 flex cursor-default scale-100"
+ className="flex scale-100 cursor-default overflow-hidden py-2"
onMouseEnter={triggerAnimation}
>
<AnimatePresence mode="wait">
{displayText.map((letter, i) => (
- <motion.h1
+ <motion.span
key={i}
className={cn("font-mono", letter === " " ? "w-3" : "", className)}
{...framerProps}
>
{letter.toUpperCase()}
- </motion.h1>
+ </motion.span>
))}
</AnimatePresence>
</div>