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
Props
SplitReveal
| Prop | Type | Default |
|---|---|---|
mode | "lines""words""chars" | "lines" |
class | string | "" |
as | keyof HTMLElementTagNameMap | "div" |
config | SplitRevealConfig | DEFAULT_CONFIG |
delay | number | 0 |
triggerOnScroll | boolean | false |
scrollElement | stringHTMLElementnull | undefined |
SplitRevealConfig
| 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 |