Motion Kit

Text

Split Reveal

Masks text and reveals lines, words, or characters on mount or scroll. Framework-agnostic Custom Element.

  • lit
  • gsap

Preview

Masks text and reveals lines, words, or characters on mount or scroll.
Attributes

Installation

pnpm dlx shadcn@latest add https://motion-kit-astro.vercel.app/r/split-reveal.json

Usage

---
import "@/components/motion-kit/split-reveal-element.ts";
---

<motion-split-reveal text="Hello World" mode="lines"></motion-split-reveal>

API Reference

Attribute Type Default
text The text content to display and animate. string ""
mode How to split the text for reveal animation. "lines" | "words" | "chars" "lines"
delay Initial delay in seconds before animation starts (not for scroll-triggered). number 0
trigger-on-scroll Whether to trigger reveal when element scrolls into view. boolean false
scroll-element CSS selector for scrollable container (defaults to window). string ""
duration Animation duration in seconds (0 = auto based on mode). number 0
stagger Stagger delay between split items in seconds (0 = auto based on mode). number 0