The Typewriter component is a fun and engaging way to display dynamic messages on your website. It simulates the effect of a typewriter, gradually typing out sentences and then backspacing to create a captivating animation.
- Smoothly transitions between different messages.
- Customizable typing speed and pause duration.
- Supports an array of motivational messages (or any other content you'd like to display).
To use the Typewriter component in your React project, follow these steps:
-
Install the package:
npm install typewriter-component
-
Import the component in your project:
import Typewriter from 'typewriter-component';
-
Use it in your JSX:
<Typewriter />
import React from 'react';
import Typewriter from 'typewriter-component';
const MyComponent = () => {
return (
<div className="my-container">
<Typewriter />
</div>
);
};
export default MyComponent;
The Typewriter component accepts the following props:
messages
: An array of strings representing the messages you want to display. Feel free to add your own motivational quotes or personal statements!typeSpeed
: The speed at which characters are typed (in milliseconds). Default:80
.deletePause
: The pause duration after a message is fully typed (before backspacing begins) in milliseconds. Default:2000
.
<Typewriter
messages={[
'I am a programmer',
'I am a student',
'I am a tech enthusiast',
'I am a data analyzer',
'I am a math lover',
'I am a cricket lover'
]}
typeSpeed={80}
deletePause={2000}
/>
Remember, every line of code you write brings you closer to your goals! Keep typing, keep learning, and keep building amazing things. 🚀