https://github.com/ctjlewis/typewriter
A Closure Compiler friendly, minimalist client-side rewrite of Matt Boldt's Typed.js.
https://github.com/ctjlewis/typewriter
javascript typewriter typing
Last synced: 20 days ago
JSON representation
A Closure Compiler friendly, minimalist client-side rewrite of Matt Boldt's Typed.js.
- Host: GitHub
- URL: https://github.com/ctjlewis/typewriter
- Owner: ctjlewis
- License: mit
- Created: 2020-01-22T20:00:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T06:58:00.000Z (over 3 years ago)
- Last Synced: 2025-12-23T09:12:08.142Z (6 months ago)
- Topics: javascript, typewriter, typing
- Language: JavaScript
- Homepage:
- Size: 2.46 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Typewriter
A minimalist rewrite of Matt Boldt's [Typed.js](https://github.com/mattboldt/typed.js/).
[View the demo on GitHub Pages](https://teleworkinc.github.io/typewriter/).
---
## React
```
```
or
```
My prefill text
```
**Traditional usage:**
1. Include with ``.
2. Call with `new Typed(selector, strings, config)`.
`selector` should be a CSS selector (will only select first match) for the element to bind to, `strings` should be an array containing the strings to transition to, and `config` is an optional argument that should be an object of form:
```
{
"default": "This is my default string.",
"typeSpeed": 100, // default: "natural"
"backSpeed": 75, // default: "natural"
"cursor": false,
"highlight": true,
"loop": false,
}
```
i.e., `new Typewriter("#typed-text", ["My first string", "My second string"])`.
# Notes
- Unlike Typed.js, `loop` is true by default and starts automatically. The `default` string is set immediately, and then the strings are cycled through. Transitioning between two strings like `This is my first string` and `This is my second string` will type naturally, backspacing only to `This is my` and then typing out the rest of the string.
Client-side standalone (closure compiled) is in `dist/browser.js`.