Please use Desktop to view and interact with components
Decorativevariablelinear
Typewriter Effect
Text that types out character by character
texttypewriterreveal
Useto navigate between components
Preview
Welcome to UI-TripleD...
Code
TypeScript + React
'use client'
import { motion } from 'framer-motion'
const text = 'Welcome to UI-TripleD...'
export function TypewriterText() {
const container = {
hidden: { opacity: 0 },
visible: {
opacity: 1,
transition: {
staggerChildren: 0.05,
},
},
}
const child = {
hidden: { opacity: 0 },
visible: { opacity: 1 },
}
return (
<motion.h2
variants={container}
initial="hidden"
animate="visible"
className="text-3xl font-bold"
>
{text.split('').map((char, index) => (
<motion.span key={index} variants={child}>
{char}
</motion.span>
))}
</motion.h2>
)
}
How to Use
- 1Install Framer Motion:
npm install framer-motion - 2Copy the code from above
- 3Paste it into your project and customize as needed
- 4Colors are customizable via Tailwind CSS classes. The default theme uses dark mode colors defined in your globals.css file