2.0.1 • Published 9 months ago

react-placeholder-typing-effect v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

React Placeholder Typing Effect

A React hook that animates input placeholders with a typing effect.

Installation

To install the package, run the following command:

npm install react-placeholder-typing-effect

Usage

Once installed, you can use the component in your React project as follows:

import PlaceholderTypingEffect from 'react-placeholder-typing-effect';

const PLACEHOLDER_TEXTS = [
    'Search for any products...',
    'What are you looking for?',
    'Find great deals and discover new items!',
];
const ANIMATION_SPEED = 61;
const DISPLAY_DURATION = 1600;

export default function App() {
    return (
        <PlaceholderTypingEffect
            placeholderTexts={PLACEHOLDER_TEXTS}
            typingSpeed={ANIMATION_SPEED} // Optional
            pauseDuration={DISPLAY_DURATION} // Optional
        >
            <input type="text" className="input-field" />
        </PlaceholderTypingEffect>
    );
}
2.0.1

9 months ago

2.0.0

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago