Custom Components
Typewriter Text
Typewriter Text
Instructions
Overview
Add dynamic typewriter text animations to your website with customizable speeds, delays, and trigger options.
Getting Started
Quick Start
- Click the Copy Component button on the top of the page.
- Paste the component into your Webstudio site.
Manual Start
- Add the Script: Copy and paste this code into your website's after the component:
[code-block]<script type="module" src="https://drevo.b-cdn.net/Library/Custom%20Components/Typewriter%20Text/typewriter-v1.1.js"></script>[/code-block]
- Add the Attribute: Add the
dv-typewriter
attribute to any text element you want to animate:<p dv-typewriter="auto">First text|Second text|Third text</p>
Customization Options
Trigger Types
- Use these options in the
dv-typewriter
attribute:auto
= Starts typing immediately when loaded (default)inview
= Starts typing when scrolled into view
- Example:
dv-typewriter="inview"
Animation Settings
duration-X
= Typing speed in milliseconds (default: 50)delete-X
= Deleting speed in milliseconds (default: 50)before-delete-X
= Delay before deleting text in milliseconds (default: 2000)before-type-X
= Delay before typing next text in milliseconds (default: 500)loop
= Continuously cycles through all text variations- Example:
dv-typewriter="auto duration-100 delete-80 before-delete-3000 loop"
Text Content
- Separate different text variations with the pipe character
|
- Example:
<span dv-typewriter="auto">Hello|Bonjour|Hola</span>
Notes
- The cursor blinks automatically during typing and pauses
- Without the
loop
option, animation stops after typing the last text variation - For best results, keep text variations similar in length
- Works with any text element including headings, paragraphs, and spans