2.0.4 • Published 5 years ago

@xlanor/react-native-animated-ellipsis v2.0.4

Weekly downloads
25
License
MIT
Repository
github
Last release
5 years ago

This project was forked from adorableio, because the maintainer has not been replying for the last few months and I have too many of this in my projects.

React Native Animated Ellipsis

A simple, customizable animated dots component for use in React Native apps. Ideal for loading screens.

Kinda like iOS

Installation

npm install --save @xlanor/react-native-animated-ellipsis

Importing

import AnimatedEllipsis from '@xlanor/react-native-animated-ellipsis';

Jest issue with scoped libraries.

Add the following after setupFilesAfterEnv

    "transformIgnorePatterns": ["^/node_module/[A-Za-z1-9./_-]*$"]

Usage

Just include the component in the output of any other component like this:

render() {
  return (
    <View>
      <Text>
        Loading
        <AnimatedEllipsis />
      </Text>
    </View>
  );
}

which will get you something like this:

Basic Example

Props

Customize the number of dots, animation speed, and style using these props:

PropertyDescription
numberOfDotsThe number of dots you'd like to show. Defaults to 3.
animationDelayThe length in milliseconds of each phase of the animated. Defaults to 300.
minOpacityThe minimum opacity for the dots. Defaults to 0.
styleCSS to apply to the dots. It accepts any styles that a normal <Text /> component can take.
useNativeDriverSpecify true or false. Defaults to true.

More Examples

Ten Dots Example(https://raw.githubusercontent.com/wiki/adorableio/

-animated-ellipsis/images/example_ten_dots.gif)

<AnimatedEllipsis numberOfDots={10} />

Complex Example

<AnimatedEllipsis numberOfDots={4}
                  animationDelay={150}
                  style={{
                    color: 'red',
                    fontSize: 72,
                  }}
/>

Kinda like iOS

<AnimatedEllipsis numberOfDots={3}
                  minOpacity={0.4}
                  animationDelay={200}
                  style={{
                    color: '#94939b',
                    fontSize: 100,
                    letterSpacing: -15,
                  }}
  />
2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago