Skip to content
On this page

Props

NameTypeDefaultDescription
elementStringspanThe HTML element to use for the wrapper.
stringsArray["Hello", "World"]Strings to type out when using autoStart option
cursorStringpipe characterString value to use as the cursor.
delayNumbernaturalnatural
deleteSpeedNumbernaturalnatural
loopBooleanfalseWhether to loop the strings.
autoStartBooleantrueWhether to start typing automatically.
pauseForNumber1500The pause duration after a string is typed when using autostart mode.
devModeBooleanfalseWhether or not to display console logs.
skipAddStylesBooleanfalseWhether or not to skip adding styles to the document.
wrapperClassNameStringTypewriter__wrapperThe class name to use for the wrapper element.
cursorClassNameStringTypewriter__cursorThe class name to use for the cursor element.
stringSplitterFunctionnullA function that splits the string into an array of characters. Example
onCreateTextNodeFunctionnullCallback function to replace the internal method which creates a text node for the character before adding it to the DOM. If you return null, then it will not add anything to the DOM and so it is up to you to handle it.
onRemoveNodeFunctionnullCallback function when a node is about to be removed. First param will be an object { node: HTMLNode, charater: string }

See the Typewriter Effect package for more information.