1.0.1 • Published 7 years ago

react-type-in-and-out v1.0.1

Weekly downloads
11
License
-
Repository
github
Last release
7 years ago

ReactTypeInAndOut

Component to simulate the effect of typing in and typing out of a text

Demo & Examples

Live demo: JRigotti.github.io/react-type-in-and-out

To try it locally: clone this repo, cd into it and build the examples with the following commands:

npm install
npm start

Then open localhost:8000 in a browser.

Installation

You can get ReactTypeInAndOut from NPM and include it in your project with your build tool of preference (such as Browserify, Webpack, etc).

npm install react-type-in-and-out --save

Usage

The minimal usage of this component can be done through passing a list of words you want to rotate. You can also control the typing speed, delays between words and a few otheroptions described in the properties section below.

var ReactTypeInAndOut = require('react-type-in-and-out');
// or
import ReactTypeInAndOut from 'react-type-in-and-out';

<ReactTypeInAndOut
    words{['React', 'type', 'in', 'and', 'out']}
/>

Properties

PropertyTypeDefaultDescription
wordsArray[]The list of words that are going to rotate
speedint150The typing speed of the text
delayRestartint0The interval before the list starts again
delayStartint0The delay before the typing starts
delayOnWordFinishint0The delay at the end of a fully typed word
showCursorbooleantrueShow cursor at the end of the text
startFullWordbooleanfalseStart component will full word displayed
classNamestring'react-type-in-and-out'The class attribute of the component

Notes

  • The cursor blinking effect is acquired though css, this project comes with an implementation which you can get at src/ReactTypeInAndOut.css
  • className + '__icon' by default 'react-type-in-and-out__icon' is the class of the icon
  • className + '__icon--animated' by default 'react-type-in-and-out__icon--animated' is an added class to the icon when the cursor starts blinking
  • Speed and delay properties are all in milliseconds

License

MIT (c) 2017 Jean Rigotti.