Skip to Content
Neshel-UI
Animations (experimental)Effects

Typography & Text

The 11 effects T01–T11: purpose, API, options, examples, reduced motion and cost.

Experimental and not on npm

@neshel-ui/animations is a private package (0.0.0). It cannot be installed, and its API may change before a first publication. These pages document what exists in the repository.

Text effects split text without hiding it from anyone: one accessible copy keeps the original nodes and the visual pieces are aria-hidden. Grapheme clusters, bidirectional text and shaping scripts are respected; links and controls are never split. Each effect writes one value per frame and text.css does the per-piece math; without it the text is visible and static. Long texts are limited by maxPieces. All return a control with play, pause, seek, track and drive.

T01 · Split reveal

<TextReveal> reveals split pieces (chars, words or lines) with a variant such as fade-up or blur; stagger and order shape the sequence. Line pieces regroup on resize without replaying.

Import
@neshel-ui/animations/text
API
TextReveal, createTextReveal
Stylesheet
@neshel-ui/animations/text.css
Reduced motion
instant — the end state appears at once
Performance
One write per frame on the visual root and CSS per piece; the cost grows with the number of pieces.
Preview: T01
Preview theme: T01

Rooted in faith, built with hope.

t01.tsx
"use client";
import "@neshel-ui/animations/text.css";
import { TextReveal } from "@neshel-ui/animations/text";
import { Button } from "@neshel-ui/components";
import { useState } from "react";

export default function T01Example() {
  const [run, setRun] = useState(0);
  return (
    <div className="grid justify-items-start gap-3">
      <TextReveal key={run} as="p" split="words" variant="fade-up" trigger="mount">
        Rooted in faith, built with hope.
      </TextReveal>
      <Button variant="outline" onClick={() => setRun(run + 1)}>
        Replay
      </Button>
    </div>
  );
}
Options: TextRevealOptions

TextRevealOptions

TextRevealOptions
PropTypeDefaultDescription
distancestring"0.6em"CSS length of the slide (default "0.6em").
durationnumber—ms (0–10000; default per effect).
easingEasing | EasingPreset——
localestring——
maxPiecesnumber——
onComplete(result: MotionResult) => void——
orderRevealOrder"start"Default "start".
progressProgressSource—Drive the effect from a 0–1 source (ScrollProgress, motion value, …) instead of its clock.
reducedMotionReducedMotion——
seednumber—Seed of order: "random" (deterministic).
splitSplitGranularity"words"Default "words".
staggernumber—Overlap between pieces: 0 (together) … 1 (one after another); default 0.2.
triggerTextTrigger"visible"When the effect plays by itself (default "visible"). Ignored with progress.
variantRevealVariant"fade-up"Default "fade-up".

T02 · Typewriter

<Typewriter> shows speed graphemes per second with an optional caret. The full sentence is accessible from the start, the layout does not move, and finish() shows everything.

Import
@neshel-ui/animations/text
API
Typewriter, createTypewriter
Stylesheet
@neshel-ui/animations/text.css
Reduced motion
instant — the end state appears at once
Performance
One write per frame on the visual root and CSS per piece; the cost grows with the number of pieces.
Preview: T02
Preview theme: T02
The complete sentence is accessible from the first frame.
t02.tsx
"use client";
import "@neshel-ui/animations/text.css";
import { Typewriter } from "@neshel-ui/animations/text";
import { Button } from "@neshel-ui/components";
import { useState } from "react";

export default function T02Example() {
  const [run, setRun] = useState(0);
  return (
    <div className="grid justify-items-start gap-3">
      <Typewriter key={run} speed={30} caret="typing" trigger="mount">
        The complete sentence is accessible from the first frame.
      </Typewriter>
      <Button variant="outline" onClick={() => setRun(run + 1)}>
        Replay
      </Button>
    </div>
  );
}
Options: TypewriterOptions

TypewriterOptions

TypewriterOptions
PropTypeDefaultDescription
caret"typing" | "always" | "none"—"typing" (default): caret while typing; "always": also at rest; "none".
durationnumber—ms (0–10000; default per effect).
easingEasing | EasingPreset——
localestring——
maxPiecesnumber——
onComplete(result: MotionResult) => void——
progressProgressSource—Drive the effect from a 0–1 source (ScrollProgress, motion value, …) instead of its clock.
reducedMotionReducedMotion——
speednumber—Graphemes per second (1–200; default 30).
triggerTextTrigger"visible"When the effect plays by itself (default "visible"). Ignored with progress.

T03 · Scramble

<ScrambleText> decodes from random glyphs of charset; the same seed always gives the same sequence, at most rate changes per second. Width and line breaks never change.

Import
@neshel-ui/animations/text
API
ScrambleText, createScramble
Stylesheet
@neshel-ui/animations/text.css
Reduced motion
instant — the end state appears at once
Performance
One write per frame on the visual root and CSS per piece; the cost grows with the number of pieces.
Preview: T03
Preview theme: T03
DETERMINISTIC DECODE
t03.tsx
"use client";
import "@neshel-ui/animations/text.css";
import { ScrambleText } from "@neshel-ui/animations/text";
import { Button } from "@neshel-ui/components";
import { useState } from "react";

export default function T03Example() {
  const [run, setRun] = useState(0);
  return (
    <div className="grid justify-items-start gap-3">
      <ScrambleText key={run} seed={3} trigger="mount">
        DETERMINISTIC DECODE
      </ScrambleText>
      <Button variant="outline" onClick={() => setRun(run + 1)}>
        Replay
      </Button>
    </div>
  );
}
Options: ScrambleOptions

ScrambleOptions

ScrambleOptions
PropTypeDefaultDescription
charsetstring—Glyphs shown while decoding (split into graphemes; default letters, digits and symbols).
durationnumber—ms (0–10000; default per effect).
easingEasing | EasingPreset——
localestring——
maxPiecesnumber——
onComplete(result: MotionResult) => void——
progressProgressSource—Drive the effect from a 0–1 source (ScrollProgress, motion value, …) instead of its clock.
ratenumber—Glyph changes per second (1–60; default 24).
reducedMotionReducedMotion——
seednumber1Seed of the glyph sequence (default 1).
triggerTextTrigger"visible"When the effect plays by itself (default "visible"). Ignored with progress.

T04 · Gradient sweep

<GradientText> sweeps a band of color across text that otherwise keeps its own colour; repeat is 0 by default. In forced colours it is plain text. Check the contrast of the band colour.

Import
@neshel-ui/animations/text
API
GradientText, createGradientSweep
Stylesheet
@neshel-ui/animations/text.css
Reduced motion
static — the decoration or content stays still
Performance
Repaints the element (colour, gradient, clip, mask, blur or stroke) while it runs; keep the area small.
Preview: T04
Preview theme: T04

A band of colour

t04.tsx
"use client";
import "@neshel-ui/animations/text.css";
import { GradientText } from "@neshel-ui/animations/text";
import { Button } from "@neshel-ui/components";
import { useState } from "react";

export default function T04Example() {
  const [run, setRun] = useState(0);
  return (
    <div className="grid justify-items-start gap-3">
      <p className="text-3xl font-bold">
        <GradientText key={run} color="#b45309" trigger="mount">
          A band of colour
        </GradientText>
      </p>
      <Button variant="outline" onClick={() => setRun(run + 1)}>
        Replay
      </Button>
    </div>
  );
}
Options: GradientSweepOptions

GradientSweepOptions

GradientSweepOptions
PropTypeDefaultDescription
anglenumber100Gradient angle in degrees (default 100).
colorstringvar(--neshel-primary, #6366f1)Highlight colour (CSS; default var(--neshel-primary, #6366f1)).
durationnumber—One cycle, ms (default per effect).
onComplete() => void——
reducedMotionReducedMotion——
repeatnumber—Extra cycles (0–1000 or Infinity, explicit).
triggerTextTrigger"visible"visible/mount start the loop on creation (default "visible"); manual waits for play().
widthnumber—Band half-width as a fraction of the element (0.05–0.5; default 0.25).

T05 · Number roll

<NumberRoll> rolls digit columns to a new value formatted with locale and format (Intl). Assistive technology reads the formatted number once per change; there is no live region.

Import
@neshel-ui/animations/text
API
NumberRoll, createNumberRoll
Stylesheet
@neshel-ui/animations/text.css
Reduced motion
instant — the end state appears at once
Performance
One write per frame on the visual root and CSS per piece; the cost grows with the number of pieces.
Preview: T05
Preview theme: T05

1.234,50 €

t05.tsx
"use client";
import "@neshel-ui/animations/text.css";
import { NumberRoll } from "@neshel-ui/animations/text";
import { Button } from "@neshel-ui/components";
import { useState } from "react";

export default function T05Example() {
  const [value, setValue] = useState(1234.5);
  return (
    <div className="flex items-center gap-4">
      <p className="text-3xl">
        <NumberRoll value={value} locale="de-DE" format={{ style: "currency", currency: "EUR" }} />
      </p>
      <Button variant="outline" onClick={() => setValue(value + 987.6)}>
        Add
      </Button>
    </div>
  );
}
Options: NumberRollOptions

NumberRollOptions

NumberRollOptions
PropTypeDefaultDescription
durationnumber800ms (default 800).
easingEasing | EasingPreset——
formatIntl.NumberFormatOptions——
localestring——
reducedMotionReducedMotion——
value(required)number | bigint——

T06 · Rotating words

<RotatingWords> shows words one at a time every interval ms in a box as wide as the longest, so nothing shifts. It pauses on hover, focus and off screen; accessibleText is the single text read aloud.

Import
@neshel-ui/animations/text
API
RotatingWords, createRotatingWords
Stylesheet
@neshel-ui/animations/text.css
Reduced motion
static — the decoration or content stays still
Performance
One write per frame on the visual root and CSS per piece; the cost grows with the number of pieces.
Preview: T06
Preview theme: T06

Design systems that are calm

t06.tsx
"use client";
import "@neshel-ui/animations/text.css";
import { RotatingWords, type RotatingWordsControl } from "@neshel-ui/animations/text";
import { Button } from "@neshel-ui/components";
import { useRef } from "react";

export default function T06Example() {
  const words = useRef<RotatingWordsControl | null>(null);
  return (
    <div className="grid justify-items-start gap-3">
      <p className="text-xl">
        Design systems that are{" "}
        <RotatingWords controlRef={words} words={["calm", "modular", "accessible"]} />
      </p>
      <Button variant="outline" onClick={() => words.current?.pause()}>
        Pause
      </Button>
    </div>
  );
}
Options: RotatingWordsOptions

RotatingWordsOptions

RotatingWordsOptions
PropTypeDefaultDescription
accessibleTextstring—Accessible text (default: the words joined by ", ").
durationnumber—Swap transition ms (0–2000; default 450).
intervalnumber—ms each word stays (1000–20000; default 2500).
onComplete() => void——
pauseOnHoverbooleantruePause while hovered or focused (default true).
reducedMotionReducedMotion——
repeatnumber—Extra cycles (0–1000 or Infinity, explicit).
triggerTextTrigger"visible"visible/mount start the loop on creation (default "visible"); manual waits for play().
variant"slide-up" | "slide-down" | "fade"——
words(required)readonly string[]——

T07 · Kinetic wave

<WaveText> moves graphemes in a sine wave of amplitude for repeat extra cycles and returns to rest. It is decorative and off under reduced motion; keep it for short words.

Import
@neshel-ui/animations/text
API
WaveText, createTextWave
Stylesheet
@neshel-ui/animations/text.css
Reduced motion
off — no motion at all
Performance
One write per frame on the visual root and CSS per piece; the cost grows with the number of pieces.
Preview: T07
Preview theme: T07
A wave that ends
t07.tsx
"use client";
import "@neshel-ui/animations/text.css";
import { WaveText } from "@neshel-ui/animations/text";
import { Button } from "@neshel-ui/components";
import { useState } from "react";

export default function T07Example() {
  const [run, setRun] = useState(0);
  return (
    <div className="grid justify-items-start gap-3">
      <WaveText key={run} amplitude="0.25em" repeat={1} trigger="mount">
        A wave that ends
      </WaveText>
      <Button variant="outline" onClick={() => setRun(run + 1)}>
        Replay
      </Button>
    </div>
  );
}
Options: TextWaveOptions

TextWaveOptions

TextWaveOptions
PropTypeDefaultDescription
amplitudestring"0.18em"CSS length (default "0.18em"; keep ≤ 0.5em).
durationnumber—One cycle, ms (default per effect).
localestring——
maxPiecesnumber——
onComplete() => void——
reducedMotionReducedMotion——
repeatnumber—Extra cycles (0–1000 or Infinity, explicit).
spreadnumber—Phase offset between clusters in radians (0–3; default 0.5).
triggerTextTrigger"visible"visible/mount start the loop on creation (default "visible"); manual waits for play().

T08 · Highlighter

<Highlight> draws a marker band or an underline (variant) behind inline text, across line breaks and in the reading direction. Forced colours draw a system underline instead. Use <mark> semantics yourself if the meaning matters.

Import
@neshel-ui/animations/text
API
Highlight, createHighlighter
Stylesheet
@neshel-ui/animations/text.css
Reduced motion
instant — the end state appears at once
Performance
Repaints the element (colour, gradient, clip, mask, blur or stroke) while it runs; keep the area small.
Preview: T08
Preview theme: T08

Contrast is checked for you at build time.

t08.tsx
"use client";
import "@neshel-ui/animations/text.css";
import { Highlight } from "@neshel-ui/animations/text";
import { Button } from "@neshel-ui/components";
import { useState } from "react";

export default function T08Example() {
  const [run, setRun] = useState(0);
  return (
    <div className="grid justify-items-start gap-3">
      <p>
        Contrast is{" "}
        <Highlight key={run} trigger="mount">
          checked for you
        </Highlight>{" "}
        at build time.
      </p>
      <Button variant="outline" onClick={() => setRun(run + 1)}>
        Replay
      </Button>
    </div>
  );
}
Options: HighlighterOptions

HighlighterOptions

HighlighterOptions
PropTypeDefaultDescription
colorstring—Band colour (CSS; default translucent yellow, --neshel-highlight-color).
durationnumber—ms (0–10000; default per effect).
easingEasing | EasingPreset——
onComplete(result: MotionResult) => void——
progressProgressSource—Drive the effect from a 0–1 source (ScrollProgress, motion value, …) instead of its clock.
reducedMotionReducedMotion——
triggerTextTrigger"visible"When the effect plays by itself (default "visible"). Ignored with progress.
variant"marker" | "underline"—"marker" (default; most of the line height) or "underline" (a low band).

T09 · Text mask

<TextMask> reveals lines with variant "rise" (inside clipped line boxes) or "wipe"; scope: "element" masks the whole element instead. Without mask support the text is simply visible.

Import
@neshel-ui/animations/text
API
TextMask, createTextMask
Stylesheet
@neshel-ui/animations/text.css
Reduced motion
instant — the end state appears at once
Performance
One write per frame on the visual root and CSS per piece; the cost grows with the number of pieces.
Preview: T09
Preview theme: T09

Each line rises inside its own box, so nothing around it moves.

t09.tsx
"use client";
import "@neshel-ui/animations/text.css";
import { TextMask } from "@neshel-ui/animations/text";
import { Button } from "@neshel-ui/components";
import { useState } from "react";

export default function T09Example() {
  const [run, setRun] = useState(0);
  return (
    <div className="grid justify-items-start gap-3">
      <TextMask key={run} as="p" variant="rise" trigger="mount" className="max-w-[32ch]">
        Each line rises inside its own box, so nothing around it moves.
      </TextMask>
      <Button variant="outline" onClick={() => setRun(run + 1)}>
        Replay
      </Button>
    </div>
  );
}
Options: TextMaskOptions

TextMaskOptions

TextMaskOptions
PropTypeDefaultDescription
durationnumber—ms (0–10000; default per effect).
easingEasing | EasingPreset——
localestring——
onComplete(result: MotionResult) => void——
progressProgressSource—Drive the effect from a 0–1 source (ScrollProgress, motion value, …) instead of its clock.
reducedMotionReducedMotion——
scope"lines" | "element"——
staggernumber0.25Line overlap 0–1 (default 0.25).
triggerTextTrigger"visible"When the effect plays by itself (default "visible"). Ignored with progress.
variant"rise" | "wipe"——

T10 · Variable-font axes

<FontAxes> animates variable-font axes between from and to, toggled with active. Registered axes use the high-level CSS properties and custom ones merge with your variation settings; a static font jumps between its weights.

Import
@neshel-ui/animations/text
API
FontAxes, createFontAxes
Stylesheet
none needed
Reduced motion
static — the decoration or content stays still
Performance
Changing font axes lays the text out again on each frame; use it on short texts.
Preview: T10
Preview theme: T10

Variable weight

t10.tsx
"use client";
import { FontAxes } from "@neshel-ui/animations/text";
import { Button } from "@neshel-ui/components";
import { useState } from "react";

export default function T10Example() {
  const [bold, setBold] = useState(false);
  return (
    <div className="grid justify-items-start gap-3">
      <p className="text-2xl">
        <FontAxes from={{ wght: 300 }} to={{ wght: 800 }} active={bold}>
          Variable weight
        </FontAxes>
      </p>
      <Button variant="outline" aria-pressed={bold} onClick={() => setBold(!bold)}>
        Bold
      </Button>
    </div>
  );
}
Options: FontAxesOptions

FontAxesOptions

FontAxesOptions
PropTypeDefaultDescription
durationnumber—ms (0–10000; default per effect).
easingEasing | EasingPreset——
from(required)FontAxes——
onComplete(result: MotionResult) => void——
progressProgressSource—Drive the effect from a 0–1 source (ScrollProgress, motion value, …) instead of its clock.
reducedMotionReducedMotion——
to(required)FontAxes——
triggerTextTrigger"visible"When the effect plays by itself (default "visible"). Ignored with progress.

T11 · Line reveal on scroll

<LineReveal> reveals lines from a source — a ScrollProgress, a motion value — in mode "scrub", or once past a threshold with "enter". Under reduced motion every line is shown.

Import
@neshel-ui/animations/text
API
LineReveal, createLineReveal
Stylesheet
@neshel-ui/animations/text.css
Reduced motion
instant — the end state appears at once
Performance
One write per frame on the visual root and CSS per piece; the cost grows with the number of pieces.
Preview: T11
Preview theme: T11

The text family receives progress as a value and never imports the scroll family.

t11.tsx
"use client";
import "@neshel-ui/animations/text.css";
import { motionValue } from "@neshel-ui/animations/core";
import { LineReveal } from "@neshel-ui/animations/text";
import { useMemo } from "react";

export default function T11Example() {
  const source = useMemo(() => motionValue(1), []);
  return (
    <div className="grid gap-3">
      <label className="grid gap-1">
        Progress (pass a ScrollProgress on a page)
        <input
          type="range"
          min={0}
          max={1}
          step={0.01}
          defaultValue={1}
          onChange={(event) => source.set(Number(event.currentTarget.value))}
        />
      </label>
      <LineReveal source={source} mode="scrub" className="max-w-[36ch]">
        The text family receives progress as a value and never imports the scroll family.
      </LineReveal>
    </div>
  );
}
Options: LineRevealOptions

LineRevealOptions

LineRevealOptions
PropTypeDefaultDescription
distancestring"0.6em"CSS length of the slide (default "0.6em").
durationnumber—ms (0–10000; default per effect).
easingEasing | EasingPreset——
localestring——
maxPiecesnumber——
mode"scrub" | "enter"—"scrub" (default): lines follow the source; "enter": play once past threshold.
onComplete(result: MotionResult) => void——
orderRevealOrder"start"Default "start".
reducedMotionReducedMotion——
seednumber—Seed of order: "random" (deterministic).
sourceProgressSource—0–1 progress source; required for scrub, optional for enter (default IntersectionObserver).
staggernumber—Overlap between pieces: 0 (together) … 1 (one after another); default 0.2.
thresholdnumber0.25enter threshold 0–1 (default 0.25).
variantRevealVariant"fade-up"Default "fade-up".
Edit on GitHub

On this page