Text & Typography Fancy Stable

TextRoll

Single-line text that rolls to its new value per grapheme, odometer-style, whenever the value prop changes — while the real, unsplit text stays selectable and readable

Preview

Installation

pnpm add fancy-ui-svelte
import { TextRoll } from 'fancy-ui-svelte'

Usage

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

<TextRoll />

Examples

Basic Usage

Auto Ticker

An auto-incrementing counter, only the changed digits roll.

Props

PropTypeDefaultDescription
value *string-The text to display; a change after mount triggers a per-grapheme roll to the new value
direction "auto" | "up" | "down""auto"Which way the cells travel; "auto" compares the trimmed old and new values as numbers and falls back to "up" for a tie, a non-numeric change, or an empty side
duration number300Roll duration in ms, collapsed to 0 under reduced motion
stagger number15Per-cell stagger step in ms, compressed to a 200ms total spread
from "first" | "last" | "center" | number"first"Stagger origin
tabular booleanfalsefont-variant-numeric: tabular-nums on both layers, to keep digit width locked
live "off" | "polite" | "assertive""off"Live-region role/aria-live pair on the real text layer; off by default
class string-Additional CSS classes
ref HTMLSpanElement | nullnullBindable reference to the root element