Skip to content
Text & Typography Fancy Stable

LineReveal

.md

Staggered line-by-line text reveal with lines computed by pretext instead of DOM splitting

Available for Svelte 5, React, and Vue 3.

Preview

Installation

pnpm add fancy-ui-svelte
import { LineReveal } from "fancy-ui-svelte";

Usage

svelte
<script lang="ts">
	import { LineReveal } from "fancy-ui-svelte";
</script>

<div class="resize-x overflow-auto rounded border border-dashed p-4" style="max-width: 100%">
	<LineReveal
		text="Text measurement and layout, without touching the DOM. Every line you see here was computed by pretext and revealed one by one."
		font="700 32px Helvetica, Arial, sans-serif"
	/>
	<p class="text-muted-foreground mt-3 text-xs">
		Drag the resize handle — lines re-wrap instantly without replaying the animation.
	</p>
</div>

Examples

Basic Usage

Resize the container — lines re-wrap without replaying the animation.

Custom Stagger & Duration

Slow down the per-line stagger and transition.

Props

PropTypeDefaultDescription
text *string-Text to reveal
font string'600 32px "Helvetica Neue", Helvetica, Arial, sans-serif'CSS font shorthand used for both measurement and rendering
lineHeight number1.2 × font sizeLine height in pixels
stagger number0.08Delay between lines in seconds
duration number0.7Animation duration per line in seconds
delay number0Initial delay in seconds
once booleantrueAnimate only on first viewport entry
class string-Additional CSS classes