Marquee
An eased conveyor of repeated content that dissolves into soft edge fades and, on hover or focus, brakes smoothly to a stop and pulls away again instead of freezing.
Available for Svelte 5, React, and Vue 3.
Preview
<script lang="ts">
import { Marquee, ReviewCard } from "fancy-ui-svelte";
const reviews = [
{
name: "Jack",
username: "@jack",
body: "I've never seen anything like this before. It's amazing.",
img: "https://avatar.vercel.sh/jack",
},
{
name: "Jill",
username: "@jill",
body: "I don't know what to say. I'm speechless. This is amazing.",
img: "https://avatar.vercel.sh/jill",
},
{
name: "John",
username: "@john",
body: "I'm at a loss for words. This is amazing. I love it.",
img: "https://avatar.vercel.sh/john",
},
{
name: "Jane",
username: "@jane",
body: "I'm at a loss for words. This is amazing. I love it.",
img: "https://avatar.vercel.sh/jane",
},
{
name: "Jenny",
username: "@jenny",
body: "I'm at a loss for words. This is amazing.",
img: "https://avatar.vercel.sh/jenny",
},
{
name: "James",
username: "@james",
body: "I'm at a loss for words. This is amazing.",
img: "https://avatar.vercel.sh/james",
},
];
const firstRow = reviews.slice(0, 3);
const secondRow = reviews.slice(3);
</script>
<!-- Outer shell + inner panel: the same nested hairline frame the cards use. -->
<div
class="w-full rounded-[22px] border border-black/[.08] bg-[#f4f4f5] p-1.5 dark:border-white/[.08] dark:bg-[#0b0b0c]"
>
<div
class="relative flex flex-col gap-1 overflow-hidden rounded-2xl border border-black/[.06] bg-white pt-4 pb-3 dark:border-white/[.06] dark:bg-[#111113]"
>
<div class="mb-2 flex items-center justify-between px-5">
<p class="text-[13px] font-medium tracking-[-0.01em] text-zinc-900 dark:text-zinc-100">
What people say
</p>
<span
class="rounded-full border border-black/[.08] px-2.5 py-0.5 font-mono text-[11px] text-zinc-500 dark:border-white/[.08]"
>
hover to brake
</span>
</div>
<Marquee pauseOnHover class="[--duration:30s]">
{#each firstRow as review (review.username)}
<ReviewCard {...review} />
{/each}
</Marquee>
<Marquee reverse pauseOnHover class="[--duration:30s]">
{#each secondRow as review (review.username)}
<ReviewCard {...review} />
{/each}
</Marquee>
</div>
</div>Installation
Usage
<script lang="ts">
import { Marquee, ReviewCard } from "fancy-ui-svelte";
const reviews = [
{
name: "Jack",
username: "@jack",
body: "I've never seen anything like this before. It's amazing.",
img: "https://avatar.vercel.sh/jack",
},
{
name: "Jill",
username: "@jill",
body: "I don't know what to say. I'm speechless. This is amazing.",
img: "https://avatar.vercel.sh/jill",
},
{
name: "John",
username: "@john",
body: "I'm at a loss for words. This is amazing. I love it.",
img: "https://avatar.vercel.sh/john",
},
{
name: "Jane",
username: "@jane",
body: "I'm at a loss for words. This is amazing. I love it.",
img: "https://avatar.vercel.sh/jane",
},
{
name: "Jenny",
username: "@jenny",
body: "I'm at a loss for words. This is amazing.",
img: "https://avatar.vercel.sh/jenny",
},
{
name: "James",
username: "@james",
body: "I'm at a loss for words. This is amazing.",
img: "https://avatar.vercel.sh/james",
},
];
const firstRow = reviews.slice(0, 3);
const secondRow = reviews.slice(3);
</script>
<!-- Outer shell + inner panel: the same nested hairline frame the cards use. -->
<div
class="w-full rounded-[22px] border border-black/[.08] bg-[#f4f4f5] p-1.5 dark:border-white/[.08] dark:bg-[#0b0b0c]"
>
<div
class="relative flex flex-col gap-1 overflow-hidden rounded-2xl border border-black/[.06] bg-white pt-4 pb-3 dark:border-white/[.06] dark:bg-[#111113]"
>
<div class="mb-2 flex items-center justify-between px-5">
<p class="text-[13px] font-medium tracking-[-0.01em] text-zinc-900 dark:text-zinc-100">
What people say
</p>
<span
class="rounded-full border border-black/[.08] px-2.5 py-0.5 font-mono text-[11px] text-zinc-500 dark:border-white/[.08]"
>
hover to brake
</span>
</div>
<Marquee pauseOnHover class="[--duration:30s]">
{#each firstRow as review (review.username)}
<ReviewCard {...review} />
{/each}
</Marquee>
<Marquee reverse pauseOnHover class="[--duration:30s]">
{#each secondRow as review (review.username)}
<ReviewCard {...review} />
{/each}
</Marquee>
</div>
</div>Examples
Basic Usage
Two rows of review cards moving in opposite directions inside a nested frame; hover a row to brake it.
<script lang="ts">
import { Marquee, ReviewCard } from "$lib/fancy-ui/marquee";
const reviews = [
{
name: "Jack",
username: "@jack",
body: "I've never seen anything like this before. It's amazing.",
img: "https://avatar.vercel.sh/jack",
},
{
name: "Jill",
username: "@jill",
body: "I don't know what to say. I'm speechless. This is amazing.",
img: "https://avatar.vercel.sh/jill",
},
{
name: "John",
username: "@john",
body: "I'm at a loss for words. This is amazing. I love it.",
img: "https://avatar.vercel.sh/john",
},
{
name: "Jane",
username: "@jane",
body: "I'm at a loss for words. This is amazing. I love it.",
img: "https://avatar.vercel.sh/jane",
},
{
name: "Jenny",
username: "@jenny",
body: "I'm at a loss for words. This is amazing.",
img: "https://avatar.vercel.sh/jenny",
},
{
name: "James",
username: "@james",
body: "I'm at a loss for words. This is amazing.",
img: "https://avatar.vercel.sh/james",
},
];
const firstRow = reviews.slice(0, 3);
const secondRow = reviews.slice(3);
</script>
<!-- Outer shell + inner panel: the same nested hairline frame the cards use. -->
<div
class="w-full rounded-[22px] border border-black/[.08] bg-[#f4f4f5] p-1.5 dark:border-white/[.08] dark:bg-[#0b0b0c]"
>
<div
class="relative flex flex-col gap-1 overflow-hidden rounded-2xl border border-black/[.06] bg-white pt-4 pb-3 dark:border-white/[.06] dark:bg-[#111113]"
>
<div class="mb-2 flex items-center justify-between px-5">
<p class="text-[13px] font-medium tracking-[-0.01em] text-zinc-900 dark:text-zinc-100">
What people say
</p>
<span
class="rounded-full border border-black/[.08] px-2.5 py-0.5 font-mono text-[11px] text-zinc-500 dark:border-white/[.08]"
>
hover to brake
</span>
</div>
<Marquee pauseOnHover class="[--duration:30s]">
{#each firstRow as review (review.username)}
<ReviewCard {...review} />
{/each}
</Marquee>
<Marquee reverse pauseOnHover class="[--duration:30s]">
{#each secondRow as review (review.username)}
<ReviewCard {...review} />
{/each}
</Marquee>
</div>
</div>Vertical
Two vertical columns with wider edge fades.
<script lang="ts">
import { Marquee, ReviewCard } from "$lib/fancy-ui/marquee";
const reviews = [
{
name: "Jack",
username: "@jack",
body: "I've never seen anything like this before.",
img: "https://avatar.vercel.sh/jack",
},
{
name: "Jill",
username: "@jill",
body: "I'm speechless. This is amazing.",
img: "https://avatar.vercel.sh/jill",
},
{
name: "John",
username: "@john",
body: "I'm at a loss for words.",
img: "https://avatar.vercel.sh/john",
},
];
</script>
<div
class="w-full rounded-[22px] border border-black/[.08] bg-[#f4f4f5] p-1.5 dark:border-white/[.08] dark:bg-[#0b0b0c]"
>
<div
class="relative flex h-[480px] flex-row items-stretch justify-center overflow-hidden rounded-2xl border border-black/[.06] bg-white px-4 dark:border-white/[.06] dark:bg-[#111113]"
>
<Marquee vertical pauseOnHover class="[--duration:24s] [--marquee-fade:18%]">
{#each reviews as review (review.username)}
<ReviewCard {...review} />
{/each}
</Marquee>
<Marquee vertical reverse pauseOnHover class="[--duration:24s] [--marquee-fade:18%]">
{#each reviews as review (review.username)}
<ReviewCard {...review} />
{/each}
</Marquee>
</div>
</div>Eased Stop
Hover a strip: the conveyor decelerates to a stop and re-accelerates on leave. Also shows the speed prop.
<script lang="ts">
import { Marquee } from "$lib/fancy-ui/marquee";
const words = [
"Svelte 5",
"Runes",
"Tailwind v4",
"TypeScript",
"Web Animations",
"Reduced motion",
"SSR safe",
"MIT License",
];
</script>
<!-- Hover a strip: the conveyor brakes to a stop instead of freezing, and pulls away again on leave. -->
<div
class="w-full rounded-[22px] border border-black/[.08] bg-[#f4f4f5] p-1.5 dark:border-white/[.08] dark:bg-[#0b0b0c]"
>
<div
class="flex flex-col gap-3 rounded-2xl border border-black/[.06] bg-white py-6 dark:border-white/[.06] dark:bg-[#111113]"
>
<Marquee pauseOnHover speed={1.5} class="[--duration:30s] [--gap:0.75rem]">
{#each words as word (word)}
<span
class="rounded-full border border-black/[.08] bg-[#fafafa] px-3.5 py-1.5 font-mono text-[12px] tracking-tight whitespace-nowrap text-zinc-600 dark:border-white/[.08] dark:bg-[#141416] dark:text-zinc-400"
>
{word}
</span>
{/each}
</Marquee>
<Marquee pauseOnHover reverse class="[--duration:40s] [--gap:2.5rem]">
{#each words as word (word)}
<span
class="text-[28px] font-medium tracking-[-0.03em] whitespace-nowrap text-zinc-900 dark:text-zinc-100"
>
{word}
</span>
{/each}
</Marquee>
<p class="px-6 text-center font-mono text-[11px] text-zinc-500">
Hover a strip to brake it to a stop
</p>
</div>
</div>Props
| Prop | Type | Default | Description |
|---|---|---|---|
reverse | boolean | false | Reverse the scroll direction |
pauseOnHover | boolean | false | Ease the conveyor to a stop while hovered or focused, and back up on leave |
vertical | boolean | false | Scroll vertically instead of horizontally |
repeat | number | 4 | Number of times to repeat children for seamless loop |
fade | boolean | true | Dissolve items at both edges with an eased gradient mask (width via --marquee-fade, default 12%) |
speed | number | 1 | Speed multiplier on top of --duration (2 = twice as fast) |
ReviewCard.img | string | - | Avatar image URL |
ReviewCard.name | string | - | Reviewer's name |
ReviewCard.username | string | - | Reviewer's handle, shown under the name |
ReviewCard.body | string | - | Text of the review |
Slots
| Slot | Description |
|---|---|
children | Content to repeat and scroll |
Links
Related components
ContainerScroll
Scroll-driven aperture: the card opens from a bright seam as it enters the viewport while its content settles into focus and the title blurs away, with no 3D tilt
StickyScroll
Two-column scroll narrative with a scrolling item list and a sticky panel that swaps its content to the item centred in view, stacking to a single top-sticky panel over the items on narrow containers