Typed Line
Sentences type themselves out, pause, clear and move on, with typos, type effects and a gliding cursor.
pixikit.com/docs/effects/typed-line
Customize
Prefix color
Typing speed75ms
Initial delay0ms
Pause duration1500ms
Deleting speed50ms
Delete mode
Type effect
Mistakes0.00
Variable speed
Variable speed min60ms
Variable speed max120ms
Loop
Show cursor
Cursor style
Cursor character
Cursor color
Cursor blink duration0.50s
Cursor glide
Hide cursor while typing
Text colors0 of 10
Start on visible
Reverse mode
Props
28| Name | Type | Default | Description |
|---|---|---|---|
text | string | string[] | "" | A sentence, or a list of sentences typed one after another. |
as | ElementType | None | The element to render, such as h1 or span. |
prefix | string | "" | Static text shown before the typed part. |
prefixColor | string | "currentColor" | The colour of the prefix. |
typingSpeed | number | 50 | Milliseconds between typed characters. |
initialDelay | number | 0 | Milliseconds before a sentence starts typing. |
pauseDuration | number | 2000 | Milliseconds a finished sentence stays before it is cleared. |
deletingSpeed | number | 30 | Milliseconds between deleted characters; in select mode, how fast the highlight grows. |
deleteMode | "backspace" | "select" | "backspace" | How a sentence is cleared: erased one character at a time, or highlighted like a selection and removed at once. |
typeEffect | "none" | "fade" | "blur" | "rise" | "none" | How each character appears: instantly, fading in, sharpening from a blur, or rising into place. |
mistakes | number | 0 | 0 to 1: how often a wrong key is hit, noticed after a beat, erased and corrected. |
variableSpeed | boolean | false | Type each character after a random delay between the two bounds. |
variableSpeedMin | number | 60 | The shortest delay with variableSpeed, in milliseconds. |
variableSpeedMax | number | 120 | The longest delay with variableSpeed, in milliseconds. |
loop | boolean | true | Start over after the last sentence; when off, the last sentence stays. |
showCursor | boolean | true | Show a blinking cursor at the typing position. |
cursorStyle | "character" | "bar" | "block" | "underscore" | "character" | The shape of the cursor; character uses cursorCharacter. |
cursorCharacter | ReactNode | "|" | The character or node used as the cursor in the character style. |
cursorColor | string | "currentColor" | The colour of the cursor. |
cursorBlinkDuration | number | 0.5 | Half the length of one blink, in seconds; the cursor stays solid while typing. |
cursorGlide | boolean | true | Glide the cursor to each new position instead of jumping. |
hideCursorWhileTyping | boolean | false | Fade the cursor out while characters are typed or cleared. |
cursorClassName | string | None | Extra class names for the cursor. |
textColors | string[] | None | Colours for the sentences, used in turn. |
onSentenceComplete | (sentence: string, index: number) => void | None | Called with the sentence and its index each time a sentence is cleared. |
startOnVisible | boolean | false | Wait until the text scrolls into view before typing. |
reverseMode | boolean | false | Reveal each sentence from its last character back to its first. |
className | string | None |