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

preactyper

v0.7.1

Published

A Preact component that types.

Readme

import Typer from 'preactyper';

<Typer spool={['🎉 PreacTyper']} />

Installation

Node

$ npm i preactyper

or

$ yarn add preactyper

Then import:

import Typer from 'preactyper';

Browser

<script src="https://unpkg.com/[email protected]/dist/preactyper.min.js">

And access via window.Typer

Props

Each prop is listed in the format <prop>: <type> = <default-value>. Note: The typer is considered complete when it has run once through the whole spool, then an additional number of repeats through the spool, and has erased the last string if eraseOnComplete is true.

spool: string[] = ['React Typer']

  • Array of strings to type
  • Empty strings will be ignored, Unicode characters are supported

repeats: number = Infinity

  • Number of additional times to the whole spool

shuffle: boolean = false

  • Whether or not to shuffle the spool on every run
  • Shuffles on first run

initialAction: 'typing' | 'erasing' = 'typing'

  • Specifies initial action of the typer, whether to start typing or erasing

eraseOnComplete: boolean = false

  • Whether or not to erase text on typer completion, see note above.

eraseStyle: 'backspace' | 'select' | 'select-all' | 'clear' = 'backspace'

  • Style of erasing:
    • backspace: Each character is removed and classed with erased
    • select: Each character is selected and classed with selected
    • select-all: All characters are selected and classed with selected
    • clear: All characters are removed immediately and classed with erased

caretAnimationStyle: 'solid' | 'blink' | 'smooth' = 'blink'

  • Style of the caret's animation:
    • solid: Caret is just solid
    • blink: Caret blinks
    • smooth: Caret smoothly moves between 0 and 100% opacity

preTypeDelay: number = 70

  • Delay before the first type step in ms
  • After this delay, the first character is typed immediately

typeDelay: number = 70

  • Delay before every successive type step in ms

preEraseDelay: number = 2000

  • Delay before the first erase step in ms
  • After this delay, the first character is erased immediately

eraseDelay: number = 250

  • Delay before every successive erase step in ms

Events

onType(typed: string)

  • Called after a character is typed, called in conjunction with onTyped for the last character
  • typed : currently typed string

onTyped(current: string)

  • Called after the whole word is typed
  • current: string that finished typing

onErase(erased: string)

  • Called after a character is erased, called in conjunction with onErased for last character
  • erased: currently erased string

onErased(current: string)

  • Called after the whole word is erased
  • current: string that finished erasing in full

onFinish()

  • Called after the typer finishes, i.e. when it runs (repeats + 1) * spool.length times

Styles

The typer's styles are set to a relatively low specificity to allow overwriting them:

.preactyper {
  /* styles for entire typer span */
}
 
.preactyper-char {
  /* styles for any character of the typer */
}
 
.preactyper-char.typed {
  /* styles for a character that has been typed */
}
 
.preactyper-char.untyped {
  /* styles for a character that has not been typed */
}
 
.preactyper-char.erased {
  /* styles for a character that has been erased */
  /* see eraseStyle */
}
 
.preactyper-char.selected {
  /* styles for a character that has been selected */
  /* see eraseStyle */
}
 
.preactyper-caret {
  /* styles for the caret span */
}
 
.preactyper-caret.blink {
  /* animation for a smooth cursor */
}
 
.preactyper-caret.smooth {
  /* animation for a smooth caret */
}

License

License MIT