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:
Usage
Props
2000ms
Typography
A text animator that cycles through phrases with blurred vertical transitions, suitable for headlines.
npx @motion-core/cli add text-loopnpx @motion-core/cli add text-looppnpm dlx @motion-core/cli add text-looppnpm dlx @motion-core/cli add text-loopbunx @motion-core/cli add text-loopbunx @motion-core/cli add text-loopyarn dlx @motion-core/cli add text-loopyarn dlx @motion-core/cli add text-loopimport { TextLoop } from "$lib/motion-core";import { TextLoop } from "$lib/motion-core";Create magic today
<script lang="ts">
import { TextLoop } from "motion-core";
import type { ComponentProps } from "svelte";
type Props = Partial<ComponentProps<typeof TextLoop>>;
let { interval = 2000 }: Props = $props();
</script>
<p class="text-center text-5xl font-medium text-foreground">
Create <TextLoop
class="text-accent"
texts={["magic", "wonder", "impact", "value"]}
{interval}
/> today
</p>
<script lang="ts">
import { TextLoop } from "motion-core";
import type { ComponentProps } from "svelte";
type Props = Partial<ComponentProps<typeof TextLoop>>;
let { interval = 2000 }: Props = $props();
</script>
<p class="text-center text-5xl font-medium text-foreground">
Create <TextLoop
class="text-accent"
texts={["magic", "wonder", "impact", "value"]}
{interval}
/> today
</p>
| Prop | Type | Default |
|---|---|---|
texts | string[] | — |
interval | number | 2000 |
class | string | — |