Installation
Install the component
Run the following command to install the component and its dependencies:
npx @motion-core/cli add split-revealImport the component
Import the component into your Svelte file:
import { SplitReveal } from "$lib/motion-core";import { SplitReveal } from "$lib/motion-core";Usage
We’re using GSAP’s SplitText to break this content into lines, words, and
individual characters. Experiment with staggered tweens, custom ease
functions, and dynamic transforms to bring your headlines to life.
Props
SplitReveal
| Prop | Type | Default |
|---|---|---|
mode | "lines" | "words" | "chars" | "lines" |
class | string | "" |
as | keyof HTMLElementTagNameMap | "div" |
config | SplitRevealConfig | DEFAULT_CONFIG |
Config options
| Key | Type | Default |
|---|---|---|
lines.duration | number | 0.8 |
lines.stagger | number | 0.08 |
words.duration | number | 0.6 |
words.stagger | number | 0.06 |
chars.duration | number | 0.4 |
chars.stagger | number | 0.008 |