Text Reveal
forgeui/text-revealFreeComponent
A stylish effect that sequentially fades in text on page load, creating a dynamic reveal.
Live preview
live · rendered by the registry
Rendered by ForgeUI on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://forgeui.in/r/text-reveal.jsonSource
1"use client";23import { cn } from "@/lib/utils";4import { useEffect } from "react";5import { motion, stagger, useAnimate } from "motion/react";67const TextReveal = ({8 text,9 className,10 filter = true,11 duration = 0.5,12 staggerDelay = 0.2,13}: {14 text: string;15 className?: string;16 filter?: boolean;17 duration?: number;18 staggerDelay?: number;19}) => {20 const [scope, animate] = useAnimate();21 const textArray = text.split(" ");2223 useEffect(() => {24 animate(25 "span",26 {27 opacity: 1,28 filter: filter ? "blur(0px)" : "none",29 },30 {31 duration: duration,32 delay: stagger(staggerDelay),33 ease: "easeOut",34 },35 );36 }, [animate, duration, filter, staggerDelay]);3738 return (39 <div className={cn("leading-normal", className)}>40 <motion.div ref={scope}>41 {textArray.map((word, idx) => {42 return (43 <motion.span44 key={word + idx}45 className="inline-block"46 style={{47 filter: filter ? "blur(8px)" : "none",48 marginRight: "0.25rem",49 opacity: 0,50 }}51 >52 {word}53 </motion.span>54 );55 })}56 </motion.div>57 </div>58 );59};6061export default TextReveal;
Files it writes
More from ForgeUI
All 28 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Formanimated-form | ForgeUI | Components | Free | no deps | |
| Animated OTPanimated-otp | ForgeUI | Components | Free | no deps | |
| Animated Tabsanimated-tabs | ForgeUI | Components | Free | no deps | |
| Auralisauralis | ForgeUI | Components | Free | no deps | |
| Bot Detectionbot-detection | ForgeUI | Components | Free | no deps | |
| Chromatic Fluidchromatic-fluid | ForgeUI | Components | Free | no deps | |
| Cloudscapecloudscape | ForgeUI | Components | Free | no deps | |
| Cosmicriftcosmicrift | ForgeUI | Components | Free | no deps |
