GSAP Text
A cinematic kinetic typography component that creates a layered 3D depth effect using continuous vertical text motion.
Installation#
pnpm dlx shadcn@latest add @davinciui/gsap-textUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
textText rendered in the main layer and every clone. \n sequences become line breaks. | string | "GSAP TEXT" |
htmlTagSemantic tag for the accessible main text. Clones are always divs with aria-hidden. | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "h1" |
fontStructured font object (fontFamily, fontSize, fontWeight, lineHeight, letterSpacing, variant). Numbers become px. | KineticTextFont | — |
textColorFollows the site theme (light mode: dark text, dark mode: light text). Pass an explicit color to fix it. | string | "var(--foreground)" |
backgroundColorFollows the site theme so every layer masks seamlessly against the stage. Pass an explicit color to fix it. | string | "var(--background)" |
directionFlow direction. Up/down create one clone per layer; both creates two (±distance/2). | "up" | "down" | "both" | "both" |
layerCountNumber of independent GSAP timelines. Both renders 2 clones per layer. | number | 10 |
distanceTotal vertical travel in px. Both splits it to ±distance/2 per clone. | number | 300 |
durationSeconds per tween. Also drives each layer's phase offset: (layerIndex / layerCount) * duration. Eased with power3.out, loops forever. | number | 4 |
classNameExtra classes for the outer wrapper. | string | — |
textClassNameExtra classes applied to the main text. | string | — |
Accessibility#
The main text renders in the semantic tag chosen by htmlTag, and every animated clone is aria-hidden. There are no keyboard controls or pause mechanism; motion runs continuously, which is a caveat for users who need to stop movement.
Motion#
Each layer runs an infinite GSAP timeline that translates cloned text vertically with power3.out easing, offset by layerCount and duration. distance sets travel and direction sets flow. The source does not check prefers-reduced-motion and provides no way to disable the looping animation.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

