Text Animations
Typing Animation
A typing animation component that simulates typing effects for an engaging text display.
Overview
The TypingAnimation component simulates a typing effect, where words are typed out one character at a time. It is perfect for creating engaging and interactive text animations in hero sections, headers, or intro animations.
Key features include:
- Typing Effect: Words are typed one character at a time for a realistic effect.
- Customizable Speed: Modify the typing speed and switch delay between words.
- Word Loop: The component loops through an array of words indefinitely.
I'm a
CLI Installation
If you’re using ChaiUI's registry system, install via:
Manual Installation
To manually set up the TypingAnimation component in your project, follow these steps:
- Go to your
srcdirectory. - Create a folder structure:
components/ui/textAnimations. - Inside the
textAnimationsfolder, create a file namedtextAnimations.tsx. - Paste the following code into
textAnimations.tsx.
Usage
Import and use the TypingAnimation component like this:
Props
| Prop | Type | Description | Default |
|---|---|---|---|
words | string[] | An array of words to type out sequentially. | –(required)` |
typingSpeed | number | Speed of typing effect in milliseconds (lower is faster). | "150" |
switchDelay | number | Time delay between switching words in milliseconds. | "1000" |