A simple AlpineJS plugin to create a typewriter effect
npm install @marcreichel/alpine-typewriter
An Alpine.js plugin to add a typewriter effect to any HTML element.
!hero
Include the following tag in the of your document, just before Alpine.
``html`
`shell`
npm install @marcreichel/alpine-typewriter
Add the x-typewriter directive to your project by importing the package before starting Alpine.
`js
import Alpine from 'alpinejs';
import Typewriter from '@marcreichel/alpine-typewriter';
Alpine.plugin(Typewriter);
Alpine.start();
`
Simply add the x-typewriter directive to any HTML element and provide the texts which should be cycled through.
`html`
By default, a text stays for 2 seconds before being swapped out. This behavior may be adjusted using a modifier like so:
`html`
or
`html`
To add a blinking cursor add the cursor modifier like so:
`html``
Copyright (c) 2023 Marc Reichel and contributors.
Licensed under the MIT license, see LICENSE for details.