Skip to content

Posts › Development

Development

Vue component for Typing effect

A package for a vue plugin for rendering text-typing animation

2 min read
Vue component for Typing effect

Introduction

With this plugin you can render a typing effect on your application or website. It may be configured to have a fixed text, and any number of typed texts. It also allows to define speed and delays. Please check the configuration section for further details.

You can see an example on my website http://www.robertogallea.com

Example

Installation

You can install the package using npm with:

npm i vue-typed-text

Usage

In order to use the package, import it in your main assets

js
 1import VueTyping from 'vue-typed-text'
 2
 3Vue.use(VueTyping)

Then you can use it in your application

Example

html
 1<text-typing fixed-text="Read while I type about"
 2             :texts="['Javascript', 'Vue', 'Anything else', 'Do you like it?']"
 3             :speed="100"
 4             :delay="3000"
 5             fixed-text-class="text-white"
 6             dynamic-text-class="text-teal-200"
 7             caret-class="text-white"></text-typing>

Configuration

Property Description Type Required Default value
fixed-text The text which is always shown 207-210mA No Empty string
texts An array of typed texts Array Yes
Speed The speed of the typing animation in ms for character Number No 100
Delay The amount of time (in ms) waited before typing the next text Number No 3000
fixed-text-class The class(es) to apply to the fixed text String Array No
dynamic-text-class The class(es) to apply to the typed text String Array No
caret-class The class(es) to apply to the caret character String Array No