An open API service indexing awesome lists of open source software.

https://github.com/ssbeefeater/react-typed

A react wrapper for typed.js
https://github.com/ssbeefeater/react-typed

reactjs

Last synced: 8 months ago
JSON representation

A react wrapper for typed.js

Awesome Lists containing this project

README

          

# react-typed

### A react wrapper for [typed.js](https://github.com/mattboldt/typed.js)

### react-typed v2 changelog

- Rewrite in typescript
- Support for react 18
- option to start animation only when the element is visible
- new property parseRef for supporting custom components that handles ref differently (see last example)
- update docs with latest storybook version

---

[Installation](#installation)

[Docs & Examples](http://ssbeefeater.github.io/react-typed)

---

#### Installation

Install with [yarn](https://yarnpkg.com) or [npm](https://www.npmjs.com/)

```sh
yarn add react-typed
#or
npm install react-typed --save
```

---

#### Examples

```javascript
import { ReactTyped } from "react-typed";

const MyComponent = () => (








);
```

###### Using typed start, stop, toggle, destroy, reset functions

```javascript
import { ReactTyped,Typed } from "react-typed";

const MyComponent {
const [typed,setTyped] = React.useState()

return (


Start
Stop
Toggle
Destroy
Reset


)
}
```

###### Start only if is visible in the dom

```javascript
import { ReactTyped } from "react-typed";

const MyComponent = () => (
startWhenVisible is true, will start when is visible in the dom",
]}
typeSpeed={40}
/>
);
```

#### Using parseRef for custom components

```javascript
import { ReactTyped } from "react-typed";
import { Input } from "antd";

const MyComponent = () => (
ref.current.input} attr="placeholder" strings={["Add a name here"]} typeSpeed={40} >


);
```