react-text-hacked
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

react-text-hacked

Reactjs Hacked Text Effect

Code inspirate by

Installation

npm i react-text-hacked

React

Declaration

/// <reference types="react" />
type TextHackedEffectComponentProps = {
  defaultText: string;
  timeOut?: number; // default value is 50
  autoStart?: boolean; // default value is false
  startOnHover?: boolean; // default value is false
  startAfterTimer?: number; // default value is false
};
declare const TextHackedEffectComponent: React.FC<TextHackedEffectComponentProps>;
export default TextHackedEffectComponent;

Usages

import { useEffect, useState } from 'react';
import './App.css';
import TextHackedEffectComponent from 'react-text-hacked';

function App() {
  const [text, setText] = useState<string>('Lorem');

  useEffect(() => {
    setTimeout(() => {
      setText('Ipsum');
    }, 2000);
    setTimeout(() => {
      setText('dolor sit amet');
    }, 4000);
  }, []);
  return (
    <div className="App">
      <div>
        <TextHackedEffectComponent defaultText={'Hover me'} startOnHover />
      </div>
      <div>
        <TextHackedEffectComponent defaultText={'Start after 2s'} startAfterTimer={2000} />
      </div>
      <div>
        <TextHackedEffectComponent defaultText={text} autoStart />
      </div>
    </div>
  );
}

export default App;

Screen

Screen example 2 Screen example

Package Sidebar

Install

npm i react-text-hacked

Weekly Downloads

3

Version

1.0.5

License

SEE LICENSE IN LICENSE

Unpacked Size

7.88 kB

Total Files

5

Last publish

Collaborators

  • joazco