Scroll Text Reveal

A smooth text animation component that reveals characters one by one as they scroll into view. The animation seamlessly reverses when scrolling away, creating a highly engaging reading experience.

uiclsxframer-motiontailwind-merge

Installation

$npx futureuikit add scroll-text-reveal

Import

import { ScrollTextReveal } from "@/components/ui/scroll-text-reveal"

Named Keys & Props

Pass these exact named keys as props on <ScrollTextReveal />. Click any color pill to copy the prop.

colorDefault is "default"(Black & White)

Usage Example

A basic implementation example to get you started.

Example Implementation
import { ScrollTextReveal } from"@/components/ui/scroll-text-reveal";

export default function Example() {
 return (
 <div className="w-full flex flex-col items-center">
 <div className="h-[60vh] flex items-center justify-center text-muted-foreground border-b border-border/50 w-full">
 <span className="animate-pulse">Scroll down to reveal text ↓</span>
 </div>
 <div className="py-32 px-4 max-w-3xl min-h-[80vh] flex items-center justify-center">
 <h2 className="text-4xl md:text-6xl font-bold tracking-tight text-center">
 <ScrollTextReveal>
 The future of UI design is here. Experience seamless, highly optimized animations that elevate your application&apos;s feel.
 </ScrollTextReveal>
 </h2>
 </div>
 <div className="h-[60vh] flex items-center justify-center text-muted-foreground border-t border-border/50 w-full">
 <span className="animate-pulse">Scroll up to see it reverse ↑</span>
 </div>
 </div>
 );
}

Features

Key capabilities and highlights.

Key Capabilities
  • ◆Powered by Framer Motion's useScroll and useTransform hooks.
  • ◆Automatically splits text into characters and ties their opacity, blur, and position to scroll progress.
  • ◆Reversible animation: elements scrub forward and backward based on scroll position.
  • ◆Easy to use: simply wrap any text inside the component.

Notes

Important implementation details to consider.

Implementation Details
  • ◆Install: Run'npx futureuikit add scroll-text-reveal'.
  • ◆Import:'import { ScrollTextReveal } from "@/components/ui/scroll-text-reveal";'
  • ◆Usage: Wrap any plain text string inside <ScrollTextReveal>.
  • ◆Customization: The animation range is based on its container entering the viewport.