npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

textimation

v0.2.1

Published

Animated Text

Readme

textimation

A tiny React component that animates text with a typewriter / scramble effect: characters shuffle through random glyphs before settling on the final string. It animates the first time it scrolls into view, and re-animates whenever the text prop changes.

Installation

npm install textimation
# or: bun add textimation · pnpm add textimation · yarn add textimation

React 18 or 19 is required (peer dependency).

Usage

import 'textimation/styles.css'
import { Textimation } from 'textimation'

function App() {
  return (
    <Textimation
      text="Hello, world!"
      Comp="p"
      animationSpeed={30}
      keepCorrectChars
    />
  )
}

Props

| Prop | Type | Default | Description | | --- | --- | --- | --- | | text | string | (required) | The text to animate to. Changing it re-runs the animation. | | animationSpeed | number | 50 | Milliseconds between character changes — lower is faster. Timing is frame-accurate (requestAnimationFrame-driven); 0 means "as fast as possible", bounded per display frame. | | type | 'random' or 'incremental' | 'random' | random scrambles every character for a similar duration; incremental settles characters roughly left-to-right. | | keepCorrectChars | boolean | false | On text changes, leave already-correct characters untouched instead of re-scrambling them. | | Comp | ElementType | 'span' | The wrapper element/component to render (e.g. 'p', 'h1'). | | className | string | — | Class applied to the wrapper element. |

Styling

Importing textimation/styles.css ships sensible defaults. While animating, each character is wrapped in a <span> carrying one of two classes that you can override:

  • .textimation-correctChar — a character that has reached its final value.
  • .textimation-incorrectChar — a character that is still scrambling.
.textimation-correctChar {
  transition: opacity 0.2s ease-in-out;
  opacity: 1;
}

.textimation-incorrectChar {
  transition: opacity 0.2s ease-in-out;
  opacity: 0.2;
}

Prefer to ship your own styles? Skip the CSS import and define those two classes yourself.

Design notes

  • Monospace fonts. The effect is designed for monospace fonts, where every scramble glyph has the same width. In a variable-width font the text will jitter horizontally while scrambling — that's an accepted tradeoff, not a bug; there is no per-character width reservation.
  • Reduced motion. When the user's system sets prefers-reduced-motion: reduce, the scramble is skipped entirely and the final text appears immediately. This is checked at the start of each animation; there is no prop to override it.
  • Background tabs. The animation is requestAnimationFrame-driven, so it pauses in hidden tabs and resumes on focus without a catch-up burst.
  • Unicode. Text is split by code points, so surrogate-pair characters like emoji animate as single units. Multi-code-point grapheme clusters (ZWJ sequences such as 👨‍👩‍👧, flags, skin-tone modifiers) still split into their components while animating — a known limitation. Note that emoji are usually double-width even in monospace fonts, so expect minor width wobble on those slots.

Contributing

Please see CONTRIBUTING.md for contribution guidelines.

License

MIT License