Component / Text

Text Reveal

Reveal text by line, word, or character while preserving one coherent accessible name and restoring the original markup on cleanup.

Preview / words

Motion should explain what changed.

Delivery contract

Install it

pnpm add easecraft@0.1.0

The component imports stable APIs from easecraft.

Files / 00

    Dependencies / 03

    easecraft
    npm / 0.1.0
    react
    peer / >=18.2.0 <20.0.0
    react-dom
    peer / >=18.2.0 <20.0.0

    Package usage

    Use it

    import { TextReveal } from "easecraft";
    
    <TextReveal as="h2" split="words" preset="fade-rise">
      Motion should explain what changed.
    </TextReveal>

    Typed contract

    API

    PropTypeDefaultPurpose
    childrenstringrequiredReadable source text
    asHTML tag"span"Semantic host element
    split"lines" | "words" | "characters""words"Animated unit
    preset"fade" | "rise" | "fade-rise""fade-rise"Reveal behavior
    durationduration token | number"normal"Per-unit duration in ms
    distancedistance token | number"medium"Spatial travel in px
    staggerstagger token | number"normal"Delay between units
    easingeasing token | string"enter"Anime.js easing
    delaynumber0Initial delay in ms
    onComplete() => voidnoneCompletion notification

    Release requirement

    Accessibility

    Screen readers
    Receive one hidden semantic clone; animated visual units are aria-hidden.
    Reduced motion
    Skips text splitting and uses a short opacity-only transition.
    Server rendering
    Outputs the original readable text before client-side enhancement.
    Cleanup
    Restores the original HTML and removes scoped animation styles.