Installation
Install the component
Run the following command to install the component and its dependencies:
npx @motion-core/cli add marqueenpx @motion-core/cli add marqueepnpm dlx @motion-core/cli add marqueepnpm dlx @motion-core/cli add marqueebunx @motion-core/cli add marqueebunx @motion-core/cli add marqueeyarn dlx @motion-core/cli add marqueeyarn dlx @motion-core/cli add marqueeImport the component
Import the component into your Svelte file:
import { Marquee } from "$lib/motion-core";import { Marquee } from "$lib/motion-core";Usage
Motion・
Craft・
Ecosystem・
Initiative・
Transition・
Interaction・
Experience・
Playground・
Journey・
Motion・
Craft・
Ecosystem・
Initiative・
Transition・
Interaction・
Experience・
Playground・
Journey・
Motion・
Craft・
Ecosystem・
Initiative・
Transition・
Interaction・
Experience・
Playground・
Journey・
Motion・
Craft・
Ecosystem・
Initiative・
Transition・
Interaction・
Experience・
Playground・
Journey・
Motion・
Craft・
Ecosystem・
Initiative・
Transition・
Interaction・
Experience・
Playground・
Journey・
Motion・
Craft・
Ecosystem・
Initiative・
Transition・
Interaction・
Experience・
Playground・
Journey・
Props
20.000s
1.000
3
0
<script lang="ts">
import { Marquee } from "motion-core";
import type { ComponentProps } from "svelte";
type Props = Partial<ComponentProps<typeof Marquee>>;
const texts = [
"Motion・",
"Craft・",
"Ecosystem・",
"Initiative・",
"Transition・",
"Interaction・",
"Experience・",
"Playground・",
"Journey・",
];
let { duration = 20, velocity = 1, repeat = 3, gap = 0 }: Props = $props();
</script>
<div
class="flex h-full min-h-96 w-full flex-col items-center justify-center gap-4"
>
<Marquee
class="h-fit"
{gap}
{duration}
{velocity}
{repeat}
scrollElement="#docs-content-container"
>
{#each texts as text (text)}
<div class="flex items-center text-4xl font-medium">
{text}
</div>
{/each}
</Marquee>
<Marquee
class="h-fit"
{gap}
{duration}
{velocity}
{repeat}
reversed
scrollElement="#docs-content-container"
>
{#each texts as text (text)}
<div class="flex items-center text-4xl font-medium">
{text}
</div>
{/each}
</Marquee>
</div>
<script lang="ts">
import { Marquee } from "motion-core";
import type { ComponentProps } from "svelte";
type Props = Partial<ComponentProps<typeof Marquee>>;
const texts = [
"Motion・",
"Craft・",
"Ecosystem・",
"Initiative・",
"Transition・",
"Interaction・",
"Experience・",
"Playground・",
"Journey・",
];
let { duration = 20, velocity = 1, repeat = 3, gap = 0 }: Props = $props();
</script>
<div
class="flex h-full min-h-96 w-full flex-col items-center justify-center gap-4"
>
<Marquee
class="h-fit"
{gap}
{duration}
{velocity}
{repeat}
scrollElement="#docs-content-container"
>
{#each texts as text (text)}
<div class="flex items-center text-4xl font-medium">
{text}
</div>
{/each}
</Marquee>
<Marquee
class="h-fit"
{gap}
{duration}
{velocity}
{repeat}
reversed
scrollElement="#docs-content-container"
>
{#each texts as text (text)}
<div class="flex items-center text-4xl font-medium">
{text}
</div>
{/each}
</Marquee>
</div>
Props
Marquee
| Prop | Type | Default |
|---|---|---|
children | Snippet | — |
duration | number | 5 |
velocity | number | 0.5 |
repeat | number | 3 |
class | string | "" |
gap | number | 32 |
reversed | boolean | false |
scrollElement | stringHTMLElementnull | window |