1.0.0 • Published 6 years ago

react-scrolling-text v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

react-scrolling-text

Gif

As seen in Minecraft!

Gif Minecraft Gameplay Gif Minecraft

Installation

npm i --save react-scrolling-text

Usage

Default Props

import RandomTextGenerator from 'react-scrolling-text';
...
<RandomTextGenerator
  charList={['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']}
  text={'Please include text prop'}
  interval={10}
  timePerChar={200}
/>

Props

Prop NameData TypeRequired?Default ValueDescription
charListArrayNo'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'Random characters to display when scrolling
textStringNo'Please include text prop'The final text to display
intervalNumberNo10# of milliseconds between each change of random scrolling character
timePerCharNumberNo200# of milliseconds it takes to move on to next character when scrolling

Warning!!!

There are no styles included! This component will inherit from its parent

Minecraft example from above

The font being used is Press Start 2P

render(){
  return(
    <RandomText
      charList={['é', 'ä', 'í', 'ƒ', 'ñ', '*', 'π', '[', ']', 'k', '¥', 'å']}
      text={'Hello World!'}
      interval={20}
      timePerChar={200}
    />
  );
}

Todo (hopefully)

  • Include Regular Expressions into charList prop