@sergonius/typa-react
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

typa-react

Make words type themselves

NPM JavaScript Style Guide

Install

npm install --save @sergonius/typa-react
# or
yarn add @sergonius/typa-react

Usage

It's a render prop, so you can use it however you want to.

import React from 'react';
import Typa from '@sergonius/typa-react';

class Example extends React.PureComponent {
  render() {
    return (
      <Typa
        strings={['do', 'your', 'thing']} // The strings to alternate between
        speed={85} // The wait time after each letter has been typed
        delay={1200} // How long to pause for after a string is complete
        loop={true} // Whether to start over after the last word in the string array
      >
        {string => (
          <React.Fragment>
            <span>{string}</span>
            <span className="cursor" />
          </React.Fragment>
        )}
      </Typa>
    );
  }
}

License

MIT © sergonius

Readme

Keywords

none

Package Sidebar

Install

npm i @sergonius/typa-react

Weekly Downloads

1

Version

1.0.8

License

MIT

Unpacked Size

15.8 kB

Total Files

8

Last publish

Collaborators

  • sergonius