# react-ts-typewriter

> React typewriter component written in TypeScript with React 18

Latest version **0.1.8-b** (published 2022-06-23) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install react-ts-typewriter
pnpm add react-ts-typewriter
yarn add react-ts-typewriter
bun add react-ts-typewriter
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8-b |
| Published | 2022-06-23 |
| First published | 2022-06-21 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 24.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Author | Gerard Marquina Rubio |
| Maintainers | gerardmarquinarubio |
| Keywords | react, typescript, types, components |

## Links

- npm: https://www.npmjs.com/package/react-ts-typewriter
- Repository: https://github.com/gerardmarquinarubio/ReactTypewriter
- Homepage: https://github.com/gerardmarquinarubio/ReactTypewriter#readme
- Issues: https://github.com/gerardmarquinarubio/ReactTypewriter/issues
- npm.io page: https://npm.io/package/react-ts-typewriter

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^18.2.0
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.8-b (latest) — 2022-06-23
- 0.1.8-a — 2022-06-23
- 0.1.8 — 2022-06-23
- 0.1.7-b — 2022-06-22
- 0.1.7-a — 2022-06-22
- 0.1.7 — 2022-06-22
- 0.1.6-c — 2022-06-21
- 0.1.6-b — 2022-06-21
- 0.1.6 — 2022-06-21
- 0.1.5 — 2022-06-21
- 0.1.4 — 2022-06-21
- 0.1.3 — 2022-06-21
- 0.1.2 — 2022-06-21
- 0.1.1 — 2022-06-21
- 0.1.0 — 2022-06-21

## README

<h1 align="center"> 〰 ⌨️ 〰 React Typewriter 〰 ⌨️ 〰</h1>
<p align="center">
<img src="https://img.shields.io/badge/language-typescript-blue?style=flat-square&logo=typescript" /> 
<img src="https://img.shields.io/badge/react-v18.2-%2361DBFB?style=flat-square&logo=react" />
<a href="https://github.com/gerardmarquinarubio/ReactTypewriter/releases" target="_blank">
<img src="https://img.shields.io/badge/version-v0.1.8-green?style=flat-square" />
</a>
<a href="https://www.npmjs.com/package/react-ts-typewriter" target="_blank">
<img src="https://img.shields.io/badge/package-npm-red?style=flat-square&logo=npm" />
</a>
<a href="https://github.com/brillout/awesome-react-components#ui-animation" target="_blank">
<img src="https://img.shields.io/badge/featured-awesome--react--components-blueviolet?style=flat-square" />
</a>
<img src="./usage.gif" />
</p>
React Typewriter is a simple component that allows you to create a nice "typewriter" effect to any text by simply invoking the component. <a href="https://codesandbox.io/s/react-typewriter-example-mgyclf" target="_blank">Try on codesandbox.io</a>.

## Installation

```sh
npm i react-ts-typewriter
```

## Example usage

```tsx
import Typewriter from 'react-ts-typewriter';

export default function myComponent() {
    return (
        <h1>
            <Typewriter text='Hello' />
        </h1>
    )
}
```

## Props
> text : string | string[]

Text to display as string or an array of strings. **Required** 

> speed?: number = 30

How long (in ms) does the the typewriter wait after typing one character. *Defaults to 30ms*.

> loop?: boolean = false

Set to true if the typewriter should loop after finishing typing the string(s). *Defaults to false*.

> random?: number = 30

Ms of randomness that should be added after each keystroke. If set to zero then each stroke will strictly take <code>speed</code>ms to complete. *Defaults to 30ms*.

> delay?: number = 30

Ms to wait after compleating the word. Useless if loop is set to false or text is not an array. *Defaults to 30ms*.

> cursor?: boolean = true

Set to false if the typewriter should not render a blinking cursor character at the end of the string. *Defaults to true*

> onFinished?: Function = () => void

Callback function after Typewriter animation is complete, never triggers if <code>loop</code> is true. *Defaults to () => void*

> onStart?: Function = () => void

Callback function before Typewriter animation is started on each string. *Defaults to () => void*.

---
_Source: https://npm.io/package/react-ts-typewriter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
