Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-text-ticker

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-text-ticker

React Native Text Ticker/Marquee Component

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.9K
decreased by-11.33%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-text-ticker

Screenshot

examples

Description

Inspired from the great react-native-marquee, this module acts similarly but with a few extra features and props:

  • Don't scroll the text if it fits in the container
  • Infinitely scroll text in a ticker fashion
  • Bounce text from side to side if it's only slightly wider than its container
  • Grab the text and scroll it manually

To see it in action check out the example!

Installation

npm install --save react-native-text-ticker
or
yarn add react-native-text-ticker

Usage

This module can be used as a drop in replacement for the react-native Text component (extra props optional).

import React, { PureComponent } from 'react'
import { StyleSheet, View } from 'react-native'
import TextTicker from 'react-native-text-ticker'

export default class Example extends PureComponent {
  render(){
    return(
      <View style={style.container}>
        <TextTicker
          style={{ fontSize: 24 }}
          duration={3000}
          loop
          bounce
          repeatSpacer={50}
          marqueeDelay={1000}
        >
          Super long piece of text is long. The quick brown fox jumps over the lazy dog.
        </TextTicker>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
  },
});

Properties

PropTypeOptionalDefaultDescription
styleStyleObjtrue-Text Style
durationnumbertrue150ms * length of stringNumber of milliseconds until animation finishes
loopbooleantruetrueInfinitely scroll the text
bouncebooleantruetrueIf text is only slightly longer than its container then bounce back/forwards instead of full scroll
scrollbooleantruetrueGives the ability to grab the text and scroll for the user to read themselves. Will start scrolling again after marqueeDelay or 3000ms
marqueeOnMountbooleantruetrueWill start scroll as soon as component has mounted. Disable if using methods instead.
marqueeDelaynumbertrue0Number of milliseconds to wait before starting marquee
useNativeDriverbooleantruetrueUse native animation driver, should remain true for large majority of use-cases
repeatSpacernumbertrue50The space between the end of your text string ticker and the beginning of it starting again.

Methods

These methods are optional and can be accessed by accessing the ref:

PropParamsDescription
startAnimationdelayStart animation
stopAnimation-Stop animation

License

MIT License

Keywords

FAQs

Package last updated on 08 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc