New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@isbosykh/typist

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@isbosykh/typist

A modern, framework-agnostic typing animation library with customizable speed curves

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

TypistJS

A modern, framework-agnostic typing animation library with customizable speed curves and advanced features.

Features

  • 🚀 Framework Agnostic - Works with any framework or vanilla JavaScript
  • 📈 Speed Curves - Linear, Bezier, Exponential, and Sine speed curves
  • TypeScript Support - Full TypeScript definitions included
  • 🎯 Lightweight - Small bundle size with zero dependencies
  • 🔧 Highly Configurable - Extensive customization options
  • 🎨 CSS Friendly - Easy to style and customize appearance

Installation

npm install typist-js

Quick Start

Vanilla JavaScript/TypeScript

import { TypedText } from 'typist-js';

const typed = new TypedText('#my-element', {
  strings: ['Hello World!', 'Welcome to TypistJS!', 'Enjoy typing animations!'],
  typeSpeed: 100,
  loop: true,
  typeSpeedCurvature: 'sine'
});

HTML

<!DOCTYPE html>
<html>
<head>
  <script src="https://unpkg.com/typist-js/dist/index.umd.js"></script>
</head>
<body>
  <div id="typed-text"></div>
  
  <script>
    const typed = new TypistJS.TypedText('#typed-text', {
      strings: ['Hello World!', 'This is TypistJS!'],
      typeSpeed: 50,
      loop: true
    });
  </script>
</body>
</html>

Configuration Options

OptionTypeDefaultDescription
stringsstring[][]Array of strings to type
typeSpeednumber50Typing speed in milliseconds
backSpeednumber25Backspacing speed in milliseconds
startDelaynumber0Delay before typing starts
backDelaynumber1000Delay before backspacing
loopbooleanfalseLoop through strings infinitely
showCursorbooleantrueShow blinking cursor
cursorCharstring`''`
typeSpeedCurvature'linear' | 'bezier' | 'exponential' | 'sine''sine'Speed curve type

Speed Curves

TypistJS supports different speed curves to make your typing animations more natural and engaging:

Sine (Default)

Smooth wave-like speed variation for organic, natural feel.

Linear

Constant typing speed throughout the animation.

Bezier

Smooth acceleration and deceleration, similar to CSS ease-in-out.

Exponential

Starts slow and accelerates dramatically for powerful effect.

Event Callbacks

const typed = new TypedText('#element', {
  strings: ['First string', 'Second string'],
  onStringStart: (index) => {
    console.log(`Started typing string ${index}`);
  },
  onStringComplete: (index) => {
    console.log(`Completed string ${index}`);
  },
  onComplete: () => {
    console.log('All strings completed!');
  }
});

API Methods

start()

Start or restart the typing animation.

stop()

Stop the current animation.

reset()

Reset to the beginning without starting.

destroy()

Clean up and remove all event listeners.

updateOptions(options)

Update configuration options dynamically.

typed.updateOptions({
  typeSpeed: 200,
  typeSpeedCurvature: 'exponential'
});

getCurrentString()

Get the currently active string.

getCurrentStringIndex()

Get the index of the currently active string.

isRunning()

Check if the animation is currently running.

Framework Integration Examples

React

import React, { useEffect, useRef } from 'react';
import { TypedText } from 'typist-js';

const TypedComponent: React.FC = () => {
  const elementRef = useRef<HTMLDivElement>(null);
  const typedRef = useRef<TypedText | null>(null);

  useEffect(() => {
    if (elementRef.current) {
      typedRef.current = new TypedText(elementRef.current, {
        strings: ['Hello React!', 'TypistJS works great!'],
        typeSpeed: 100,
        loop: true,
        typeSpeedCurvature: 'bezier'
      });
    }

    return () => {
      typedRef.current?.destroy();
    };
  }, []);

  return <div ref={elementRef} className="typed-text" />;
};

Vue 3

<template>
  <div ref="typedElement" class="typed-text"></div>
</template>

<script setup lang="ts">
import { ref, onMounted, onUnmounted } from 'vue';
import { TypedText } from 'typist-js';

const typedElement = ref<HTMLElement>();
let typed: TypedText | null = null;

onMounted(() => {
  if (typedElement.value) {
    typed = new TypedText(typedElement.value, {
      strings: ['Hello Vue!', 'TypistJS is awesome!'],
      typeSpeed: 100,
      loop: true,
      typeSpeedCurvature: 'sine'
    });
  }
});

onUnmounted(() => {
  typed?.destroy();
});
</script>

Svelte

<script lang="ts">
  import { onMount, onDestroy } from 'svelte';
  import { TypedText } from 'typist-js';

  let element: HTMLElement;
  let typed: TypedText | null = null;

  onMount(() => {
    typed = new TypedText(element, {
      strings: ['Hello Svelte!', 'TypistJS rocks!'],
      typeSpeed: 100,
      loop: true,
      typeSpeedCurvature: 'exponential'
    });
  });

  onDestroy(() => {
    typed?.destroy();
  });
</script>

<div bind:this={element} class="typed-text"></div>

Styling

TypistJS automatically adds CSS classes that you can style:

.typed-text-content {
  /* Style the text content */
  font-family: 'Courier New', monospace;
  color: #333;
}

.typed-text-cursor {
  /* Style the cursor */
  color: #007acc;
  font-weight: bold;
}

.typed-text-cursor.hidden {
  /* Cursor hidden state - automatically managed */
  opacity: 0;
}

Browser Support

TypistJS works in all modern browsers that support:

  • ES2018 features
  • DOM manipulation
  • setTimeout/setInterval

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Keywords

typing

FAQs

Package last updated on 28 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts