0.0.4 • Published 7 years ago

react-native-activity-indicator v0.0.4

Weekly downloads
28
License
-
Repository
github
Last release
7 years ago

react-native-activity-indicator

Based on react-native-progress.

Installation

yarn add react-native-progress react-native-activity-indicator

Definition

Same API as ActivityIndicator with two extra customization props duration and thickness.

type activityIndicator = {
  animating?: boolean,               // default = true
  color?: string | Array<string>,    // default = 'gray'
  duration?: number,                 // default = 500
  hidesWhenStopped? boolean,         // default = true
  size?: 'small' | 'large' | number, // default = 'small'
  thickness?: number                 // default = 1
};

Examples

import React from 'react';
import { View } from 'react-native';

import ActivityIndicator from 'react-native-activity-indicator';

const Example = () => (
  <View
    style={{
      alignItems: 'center',
      flex: 1,
      flexDirection: 'row',
      justifyContent: 'space-around'
    }}>
    <ActivityIndicator />
    <ActivityIndicator animating={false} />
    <ActivityIndicator color="#4285f4" />
    <ActivityIndicator color={['#db4437', '#0f9d58', '#4285f4']} />
    <ActivityIndicator duration={1000} />
    <ActivityIndicator size="large" />
    <ActivityIndicator size={24} />
    <ActivityIndicator thickness={3} />
  </View>
);

export default Example;