Un componente de React para mostrar un efecto de escritura en el placeholder de un input.
npm install react-placeholder-typing-effectA React hook that animates input placeholders with a typing effect.
To install the package, run the following command:
``bash`
npm install react-placeholder-typing-effect
Once installed, you can use the component in your React project as follows:
`tsx
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 (
typingSpeed={ANIMATION_SPEED} // Optional
pauseDuration={DISPLAY_DURATION} // Optional
>
);
}
``