Skip to content

sergonius/typa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typa

Make words type themselves

Install

npm install --save @sergonius/typa
# or
yarn add @sergonius/typa

Example

<div class="typa"></div>
import Typa from '@sergonius/typa';

const typa = new Typa({
	strings: ['do', 'your', 'thing'], // The strings to alternate between
	speed: 100, // The wait time after each letter has been typed
	delay: 1000, // How long to pause for after a string is complete
	loop: true, // Whether to start over after the last word in the string array
	containerSelector: '.typa', // The container selecor. The element must exist beforehand.
	typerClass: 'typa__typer', // A span with this class will be created in the container and will contain the content
	cursorClass: 'typa__cursor', // Optional. Will create another span for the blinking cursor, if you wish
});

typa.start();

BTW

There is also a React version typa-react

Releases

No releases published

Packages

No packages published