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 🙏

© 2025 – Pkg Stats / Ryan Hefner

typed-react-func

v1.0.8

Published

A functional React component for Typed.js

Readme

typed-react-func

A functional React component for Typed.js

Installation

npm i typed-react-func

Basic Example

import TypedComponent from 'typed-react-func'
const HelloWorldHeading = () => {
  return (
    <h1>
      <TypedComponent
        strings={['Hello', 'World']}
        loop={true}
        typeSpeed={50} 
        backSpeed={50}
        showCursor={true}
      />
    </h1>
  )
}

Props

All Typed.js constructor options are passed as props to this component. You can find them by reading the documentation

Extended props

| Prop | Type | Description | |---------|---------|---------| | ref | Typed | A reference to the Typed instance the component creates | | className | string | Adds a className to the container, default is typewriter | | isStopped | boolean | Initializes the component without starting typing | | hideCursorBeforeStart | boolean | Hides the cursor before the typing begins (only if showCursor is set to true) |

Example with following cursor (with multiple instances)

import { useRef } from 'react'
import TypedComponent from 'typed-react-func'
import Typed from 'typed.js'
const HelloWorldHeading = () => {
  const h2Ref = useRef<Typed | null>(null)
  return (
    <header>
      <h1>
        <TypedComponent 
          strings={['Hello World,']} 
          showCursor={true}
          loop={false}
          onComplete={(self) => { 
            // Start h2 when this 'Hello World' text has been written
            const cursor = (self as any).cursor
            const h2 = h2Ref.current
            if (cursor && h2) {
              cursor.remove()
              h2.start()
            }
          }}
          />
      </h1>
      <h2>
        <TypedComponent 
          strings={['My name is William']} 
          ref={h2Ref}
          showCursor={true}
          hideCursorBeforeStart={true}
          isStopped={true}
          onStart={(arrayPos, self) => { 
            // Show the cursor when the typing starts
            const cursor = (self as any).cursor
            if (cursor) 
              cursor.style.opacity = '1'
          }}
          loop={false} 
          />
      </h2>
    </header>
  )
}