Gradual Spacing Text
Gradual Spacing Text é um componente de texto para React e Tailwind CSS, da biblioteca Eldora UI, com licença MIT. Copia e cola no teu projeto.
Eldora UI
MIT
text
O que é
Gradual Spacing Text é um componente de texto para React e Tailwind CSS, da biblioteca Eldora UI, com licença MIT. Copia e cola no teu projeto.
Como usar
Abre o componente no catálogo, carrega em copiar, e cola no teu projeto. O prompt copiado leva o código e as regras para o teu agente o reproduzir sem alterar nada.
Cinco cópias grátis por mês. Sem cartão.
Precisa de
npm i motion react clsx
Licença
Este componente vem de Eldora UI e é redistribuído sob a licença MIT, que permite uso comercial. O aviso de copyright viaja com o código.
Gradual Spacing Text
"use client"
import clsx from "clsx"
import { AnimatePresence, motion } from "motion/react"
interface GradualSpacingTextProps {
text?: string
className?: string
}
export const GradualSpacingText: React.FC<GradualSpacingTextProps> = ({
text = "",
className = "",
}) => {
const gradual = {
hidden: { opacity: 0, x: -20 },
visible: { opacity: 1, x: 0 },
}
return (
<div className={clsx("flex justify-center space-x-1", className)}>
<AnimatePresence>
{text.split("").map((char, i) => (
<motion.h1
key={i}
initial="hidden"
animate="visible"
exit="hidden"
variants={gradual}
transition={{ duration: 0.5, delay: i * 0.1 }}
className={clsx(
"font-display text-center font-bold drop-shadow-sm",
"text-4xl md:text-5xl lg:text-6xl xl:text-7xl",
"tracking-[-0.02em]",
"md:leading-[4rem] lg:leading-[4.5rem] xl:leading-[5rem]"
)}
>
{char === " " ? <span> </span> : char}
</motion.h1>
))}
</AnimatePresence>
</div>
)
}