Installation
Install the component
Run the following command to install the component and its dependencies:
Import the component
Import the component into your Svelte file:
Typography
A text effect that splits characters and animates stacked layers on hover for a seamless swap.
npx @motion-core/cli add split-hovernpx @motion-core/cli add split-hoverpnpm dlx @motion-core/cli add split-hoverpnpm dlx @motion-core/cli add split-hoverbunx @motion-core/cli add split-hoverbunx @motion-core/cli add split-hoveryarn dlx @motion-core/cli add split-hoveryarn dlx @motion-core/cli add split-hoverimport { SplitHover } from "$lib/motion-core";import { SplitHover } from "$lib/motion-core";<script lang="ts">
import { SplitHover } from "motion-core";
let hoverTarget = $state<HTMLElement | null>(null);
</script>
<a bind:this={hoverTarget} class="text-lg font-medium" href="/docs/split-hover">
<SplitHover {hoverTarget}>Orbit the future</SplitHover>
</a>
<script lang="ts">
import { SplitHover } from "motion-core";
let hoverTarget = $state<HTMLElement | null>(null);
</script>
<a bind:this={hoverTarget} class="text-lg font-medium" href="/docs/split-hover">
<SplitHover {hoverTarget}>Orbit the future</SplitHover>
</a>
| Prop | Type | Default |
|---|---|---|
hoverTarget | HTMLElementnull | null |
class | string | "" |