npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

horizantal-marquee-view

v1.0.0

Published

Horizantal Marquee Text for react-native

Downloads

17

Readme

horizantal-marquee-view

A react-native horizantal marquee text component.

If you need a vertical marquee text, please use vertical-marquee-view.

Anchors

  1. Desc
  2. Install
  3. Usage
  4. Props
  5. Update Log

Desc

Skip this part, go to #Install

I needed a marquee text in one of my recent project and I didn't find a good one online, so I decided to create my own marquee text component.

I intended to make it work well on both iOS and Android, still there remains one thing in iOS which I cannot fix. I found that in iOS, when you use View component to wrap child components and don't explicitly set the parent View component width (e.g. use flex), the parent View component will have the same width as it's child.

It becomes a problem in this custom component because I use a child View component to wrap Text component in order to make the text expand and show in one line. I set the text containner View component size to be bigger than the Text so that it will not have multiple lines nor have the overflow text replaced by ellipsis. The default value of text container width is 1000, which is usually larger than the actual label width. This results in the problem mentioned above, the wrapper View width becomes 1000 also.

<View class="marquee-label">
  <View class="marquee-label-text-container">
    <Text class="marquee-label-text">{text}</Text>
  </View>
</View>

Note:

  • In Andorid, you can use both width or flex to layout the view.
  • In iOS, use width to layout the view. flex layout is not supported.

Install

npm install --save horizantal-marquee-view

Usage

  1. Import
import HorizantalMarqueeText from 'horizantal-marquee-view';
  1. Use
<HorizantalMarqueeText
  duration={8000}
  text={'This is a Marquee Label.'}
  textStyle={{ fontSize: 13, color: 'white' }}
/>

or

<HorizantalMarqueeText
  speed={250}
  textStyle={{ fontSize: 13, color: 'white' }}
>
  This is a Marquee Label.
</HorizantalMarqueeText>

Props

  • children: string, the text to show in the marquee. Alternative to text.
  • text: string, the text to show in the marquee. Alternative to children.
  • duration: number(unit: millisecond), the duration for the marquee to run one round. e.g. 6000 (for 6 seconds a round). Alternative to speed.
  • speed: number(unit: px/s, px per second), the speed of the marquee. Alternative to duration.
  • bgViewStyle: stylesheet object, background view component custom styles.
  • textStyle: stylesheet object, text component custom styles.
  • textContainerWidth: number, text container component width. If the text is not shown in one line, increase this value.
  • textContainerHeight: number, text container component height. If the text is not shown in one line, increase this value.
  • textContainerStyle: stylesheet object, not recommended to use, text containner component custom style.

Update Log

2019.08.16 Version 1.0.0

  • Dynamic Text Support: now you can use dynamic text with this component :D