Polymer 2.0 element that simulates typing similar to typed.js for jQuery.
Check out the demo and full documentation
bower install --save sespiros/typed-text
Install with bower or download the zip
<link rel="import" href="/bower_components/typed-text/typed-text.html">
<typed-text options></typed-text>
where options
can be any of:
strings
: an array of strings to be typed one after the other i.e.["Hello world!", "typed-text is awesome"]
cursor
: specify a cursor string.|
by defaultnoretype
: only backspaces to erase the part of the string that is differentnoloop
: stops typing after the last stringnoblink
: stops the cursor from blinking
The typed-text strings can be set in one of two ways:
- Using the strings property:
<typed-text strings='["Hello world", "Another sentence"]'></typed-text>
- Writing directly into the HTML element:
<typed-text>
<p>Here is the first sentence.</p>
<p>Here is another one!</p>
</typed-text>
<typed-text cursor="|"></typed-text>
- Can type and delete text
- Supports constant looping between text
- Cursor blinking and customization with custom-style
- Smart noretype to keep common parts of consecutive strings
- Style it however you want for cool effects!
Feel free to extend it or propose new functionality