@cawfree/react-native-cycle-text

1.0.1 • Public • Published

react-native-cycle-text

A simple React Native component which lets you randomly cycle through an array of text Strings.

It is compatible with react-native-web, and also has built-in hyperlink support!

🚀 Getting Started

Using npm:

npm install --save @cawfree/react-native-cycle-text

Using yarn:

yarn add @cawfree/react-native-cycle-text

✍️ Example

import TextCycler from '@cawfree/react-native-cycle-text';

export default ({ ...extraProps }) => (
  <TextCycler
    onPress={(url) => {
      // Returned if a user tapped on a hyperlink.
    }}
    duration={2000}
    nextMessage={() => {
      return Math.random() > 0.5 ? [
        'https://github.com/Cawfree are now welcome!',
        'Pull requests',
      ] : [
        'There\'s no better feeling than when somebody contributes to your repo on https://github.com/Cawfree.',
        'GitHub',
      ];
    }}
  />
);

✌️ License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @cawfree/react-native-cycle-text

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

6.08 kB

Total Files

5

Last publish

Collaborators

  • cawfree