Skip to content
Hazine

Animated numbers and text

1 of 6 shipped. Each take is a different structure, and the note under its title says how.

  • animated numbers and text

    Interpolates the whole value on an animation frame loop. The moving node is hidden from assistive technology and a visually hidden sibling carries the final value.

    shadcn add @hazine/animated-counter

Planned 5

  • Rolling digits

    Per-digit CSS transform columns that react to every value change (not a one-time count up), rolling up for increases and down for decreases, with the true value exposed once in visually hidden text.

  • Staggered text reveal

    One-shot entrance tied to an IntersectionObserver with clip-path masks per segment; the original string stays as the accessible name while the split spans are aria-hidden, and reduced motion renders the text with no transform.

  • Word rotate with pause

    Looping motion with an explicit pause control (required because it runs longer than five seconds), pause on hover and focus, and a screen-reader sentence that lists all words once instead of announcing each swap.

  • Typewriter text

    Character-level timing with a caret element and a skip-to-end control; the typed node is aria-hidden, every phrase is listed once in visually hidden text, looping motion always has a pause control, and reduced motion shows the first phrase complete with a static caret.

  • Highlight sweep

    Animates a background layer behind text that never moves or hides, so it needs no text alternative; highlight colour comes from a Hazine highlight token with a paired foreground that holds AA contrast, and reduced motion shows the finished highlight.