Skip to content

ymlihaa/write-like-chat-gpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WriteLikeChatGPT

A React component that animates text to make it appear as if it's being written by ChatGPT.

write-like-chat-gpt

🚀 Quick start

  1. Install the package: npm install write-like-chat-gpt.
  2. Import the component: import WriteLikeChatGPT from 'write-like-chat-gpt'.
  3. Use the component in your code:
<WriteLikeChatGPT text="Hello, world!" />

📝 Usage

Props

  • text: the text to animate (required)

Example

import React from 'react'; import WriteLikeChatGPT from 'write-like-chat-gpt';

const MyComponent = () => { return ( <div> <WriteLikeChatGPT text="Hello, world!" /> </div> ); };

export default MyComponent;

🤖 Technical details

This component uses the following React hooks:

  • useState
  • useEffect
  • useMemo
  • useLayoutEffect
  • useRef

It also uses the requestAnimationFrame function to animate the text.

Releases

No releases published

Packages

No packages published