For Tailwind CSS v3 docs, click here.

Text Reveal

Animate text line-by-line using GSAP's SplitText for smooth word or line entrance effects.

API

Prop NameTypeDefaultDescription
classstring-Additional classes for the inner text container.
containerClassstring-Additional classes for the outer container.
durationnumber0.6Animation duration for line reveal.
delaynumber0.2Initial delay before animation starts.
staggernumber0.1Animation delay between each line reveal.

Installation

This component depends on GSAP and GSAP SplitText.

npm
pnpm
bun
yarn
npm i gsap

Install using CLI

npm
pnpm
bun
yarn
npx shadcn-vue@latest add "https://registry.inspira-ui.com/text-reveal.json"

Install Manually

Copy and paste the following code:

TextReveal.vue

Features

  • Line-by-line animation: Automatically splits and animates lines of text.
  • Staggered entry: Smooth entrance with staggered reveal timing.
  • Scoped styling: Ensures each line is masked for clean transitions.
  • Customizable timing: Control animation duration and delay.

Credits