https://github.com/mxmzb/react-aiwriter
Typewriter effect inspired by ChatGPT 🤖
https://github.com/mxmzb/react-aiwriter
Last synced: 3 months ago
JSON representation
Typewriter effect inspired by ChatGPT 🤖
- Host: GitHub
- URL: https://github.com/mxmzb/react-aiwriter
- Owner: mxmzb
- License: mit
- Created: 2022-12-21T09:09:38.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-01T01:23:00.000Z (over 1 year ago)
- Last Synced: 2025-03-25T23:22:28.692Z (3 months ago)
- Language: TypeScript
- Homepage: https://maximzubarev.com/ai-will-steal-your-job
- Size: 3.7 MB
- Stars: 44
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
React AIWriter
Inspired by the first versions interface of ChatGPT
![]()
### Example app and usage
I've written an extensive blog post about the current state of AI and its implications on software jobs, in which I have used this library. [Check it out](https://maximzubarev.com/ai-will-steal-your-job)! You can also run the included demo app locally:
```sh
$ git clone https://github.com/mxmzb/react-aiwriter.git
$ cd react-aiwriter && yarn
$ cd example && yarn
$ yarn dev
```After installing the demo locally you can visit it at http://localhost:3000
## Intro
As I (and probably half of Twitter) have been playing around with [ChatGPT](https://chat.openai.com/chat), I came to like the way ChatGPT was rendering the words successively in a typewriter style. I found [TypewriterJS](https://github.com/tameemsafi/typewriterjs), but its configuration was too difficult to integrate arbitrary content from a CMS.
## Installation
```
$ yarn add react-aiwriter
```## Quickstart
```jsx
import AIWriter from "react-aiwriter";export default () => (
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
);
```## Documentation and API
### `AIWriter`
The main slider container, where you want to put all your slider elements inside.
| Prop | Default | Type | Description |
| :--------- | :--------: | :-----------: | :------------------------------------------------------ |
| `children` | null | `ReactNode[]` | Child elements. Should be text nodes |
| `delay` | `25` | `number` | The time between nodes / words rendered in milliseconds |
| `onFinish` | `() => {}` | `function` | Do something after all nodes / words rendered |## License
`react-aiwriter` is licensed under the [MIT](https://github.com/mxmzb/react-aiwriter/blob/master/LICENSE).