Documentation
Text Effectstextrevealshimmer

Lightning Text

Text with Lightning effect animation .

Lightning

Installation

Terminal
1npx shadcn@latest add "https://sniper-ui-coral.vercel.app/r/lightning-text.json"

Auto-Installed Dependencies

The CLI will automatically install these packages.

Terminal
1npm install gsap

Usage

Basic

page.tsx
1import { LightningText } from "@/components/ui/lightning-text"; 2 3export default function MyPage() { 4 return ( 5 <LightningText> 6 Hello World 7 </LightningText> 8 ); 9}

Examples

examples.tsx
1import { LightningText } from "@/components/ui/lightning-text"; 2 3export default function MyPage() { 4 return ( 5 <div className="space-y-4"> 6 {/* Custom color and speed */} 7 <LightningText color="#ff6b35" repeatDelay={0.8} stagger={0.02}> 8 <h1 className="text-5xl font-bold">Fast Lightning</h1> 9 </LightningText> 10 11 {/* Slower, blue effect */} 12 <LightningText color="#2b6bbb" repeatDelay={2} stagger={0.06}> 13 <p className="text-2xl">Subtle shimmer effect</p> 14 </LightningText> 15 </div> 16 ); 17}

Props

PropTypeDefaultDescription
childrenReact.ReactNodeThe content to apply the lightning effect to.
colorstring"#2b6bbb"The color of the lightning flash.
repeatDelaynumber1.5Seconds to wait before repeating the animation.
staggernumber0.04Stagger delay (in seconds) between each character's animation.