Effects Fancy Stable
TracingBeam
A reading lamp on a rail beside long-form content: it trails the reader's eye on a spring, leaves what has been read softly lit, and ticks off each heading as it passes
Available for Svelte 5, React, and Vue 3.
Preview
svelte
<script lang="ts">
import { TracingBeam } from "fancy-ui-svelte";
</script>
<TracingBeam>
<div class="max-w-2xl space-y-16">
<div>
<span class="mb-2 block text-xs font-semibold tracking-wider text-emerald-500 uppercase"
>v0.1</span
>
<h2 class="mb-3 text-xl font-semibold">The First Sketch</h2>
<p class="text-muted-foreground leading-relaxed">
It started as a folder of throwaway components and a single button that looked good in every
theme. No tokens, no docs site, just a designer and an engineer arguing about border radius
until 2am. That argument became the first commit.
</p>
</div>
<div>
<span class="mb-2 block text-xs font-semibold tracking-wider text-purple-500 uppercase"
>v0.5</span
>
<h2 class="mb-3 text-xl font-semibold">Everything Learns to Move</h2>
<p class="text-muted-foreground leading-relaxed">
Static components gave way to a proper motion layer: spring-based transitions, shared layout
animations, and a reduced-motion fallback for every single one of them. This is also when
the team agreed on a rule that stuck — nothing animates without a reason.
</p>
</div>
<div>
<span class="mb-2 block text-xs font-semibold tracking-wider text-blue-500 uppercase"
>v1.0</span
>
<h2 class="mb-3 text-xl font-semibold">Launch Day</h2>
<p class="text-muted-foreground leading-relaxed">
The API stabilized, the docs got real examples instead of placeholders, and the changelog
finally had a version worth calling stable. Version 1.0 shipped quietly on a Tuesday, which
felt right for something that took over a year of small decisions to get there.
</p>
</div>
</div>
</TracingBeam>Installation
pnpm add fancy-ui-svelte
import { TracingBeam } from "fancy-ui-svelte";
Usage
svelte
<script lang="ts">
import { TracingBeam } from "fancy-ui-svelte";
</script>
<TracingBeam>
<div class="max-w-2xl space-y-16">
<div>
<span class="mb-2 block text-xs font-semibold tracking-wider text-emerald-500 uppercase"
>v0.1</span
>
<h2 class="mb-3 text-xl font-semibold">The First Sketch</h2>
<p class="text-muted-foreground leading-relaxed">
It started as a folder of throwaway components and a single button that looked good in every
theme. No tokens, no docs site, just a designer and an engineer arguing about border radius
until 2am. That argument became the first commit.
</p>
</div>
<div>
<span class="mb-2 block text-xs font-semibold tracking-wider text-purple-500 uppercase"
>v0.5</span
>
<h2 class="mb-3 text-xl font-semibold">Everything Learns to Move</h2>
<p class="text-muted-foreground leading-relaxed">
Static components gave way to a proper motion layer: spring-based transitions, shared layout
animations, and a reduced-motion fallback for every single one of them. This is also when
the team agreed on a rule that stuck — nothing animates without a reason.
</p>
</div>
<div>
<span class="mb-2 block text-xs font-semibold tracking-wider text-blue-500 uppercase"
>v1.0</span
>
<h2 class="mb-3 text-xl font-semibold">Launch Day</h2>
<p class="text-muted-foreground leading-relaxed">
The API stabilized, the docs got real examples instead of placeholders, and the changelog
finally had a version worth calling stable. Version 1.0 shipped quietly on a Tuesday, which
felt right for something that took over a year of small decisions to get there.
</p>
</div>
</div>
</TracingBeam>Examples
Basic Usage
svelte
<script lang="ts">
import { TracingBeam } from "$lib/fancy-ui/tracing-beam";
</script>
<TracingBeam>
<div class="max-w-2xl space-y-16">
<div>
<span class="mb-2 block text-xs font-semibold tracking-wider text-emerald-500 uppercase"
>v0.1</span
>
<h2 class="mb-3 text-xl font-semibold">The First Sketch</h2>
<p class="text-muted-foreground leading-relaxed">
It started as a folder of throwaway components and a single button that looked good in every
theme. No tokens, no docs site, just a designer and an engineer arguing about border radius
until 2am. That argument became the first commit.
</p>
</div>
<div>
<span class="mb-2 block text-xs font-semibold tracking-wider text-purple-500 uppercase"
>v0.5</span
>
<h2 class="mb-3 text-xl font-semibold">Everything Learns to Move</h2>
<p class="text-muted-foreground leading-relaxed">
Static components gave way to a proper motion layer: spring-based transitions, shared layout
animations, and a reduced-motion fallback for every single one of them. This is also when
the team agreed on a rule that stuck — nothing animates without a reason.
</p>
</div>
<div>
<span class="mb-2 block text-xs font-semibold tracking-wider text-blue-500 uppercase"
>v1.0</span
>
<h2 class="mb-3 text-xl font-semibold">Launch Day</h2>
<p class="text-muted-foreground leading-relaxed">
The API stabilized, the docs got real examples instead of placeholders, and the changelog
finally had a version worth calling stable. Version 1.0 shipped quietly on a Tuesday, which
felt right for something that took over a year of small decisions to get there.
</p>
</div>
</div>
</TracingBeam>Props
| Prop | Type | Default | Description |
|---|---|---|---|
accent | string | undefined (follows --primary, falls back to oklch(0.7 0.13 285)) | Colour of the lamp, its trail and the lit markers. Any CSS colour; also settable via the --tracing-beam-accent CSS variable. |
readingLine | number | 0.38 | Where the reader's eye is assumed to be, as a fraction of the viewport height from the top. The lamp sits on that line, clamped to the content. |
markers | boolean | true | Draw a marker on the rail for every heading (h1–h4) inside the content, or for every direct child when there is none. Markers light up as the lamp passes them. |
Slots
| Slot | Description |
|---|---|
children | Long-form content the beam reads alongside |
Links
Related components
AnimatedBeam
Fibre-optic connector between two elements: a light packet with a dispersing chromatic tail runs along a glass fibre and blooms behind the destination on arrival; theme-aware, seeded and still under reduced motion.
Effects Fancy
BorderBeam
A single comet of light riding a container's border: a white-hot head, a long feathered tail fading between two colours, a dim hairline that lights up only within the comet's reach, and a soft bloom that sits on the edge.
Effects Fancy
Confetti
Confetti celebration effect powered by canvas-confetti with button trigger support
Effects Fancy