Skip to content

Latest commit

 

History

History
92 lines (63 loc) · 2.35 KB

File metadata and controls

92 lines (63 loc) · 2.35 KB
id activityindicator
title ActivityIndicator

Displays a circular loading indicator.

Example

import {ActivityIndicator, StyleSheet} from 'react-native';
import {SafeAreaView, SafeAreaProvider} from 'react-native-safe-area-context';

const App = () => (
  <SafeAreaProvider>
    <SafeAreaView style={[styles.container, styles.horizontal]}>
      <ActivityIndicator />
      <ActivityIndicator size="large" />
      <ActivityIndicator size="small" color="#0000ff" />
      <ActivityIndicator size="large" color="#00ff00" />
    </SafeAreaView>
  </SafeAreaProvider>
);

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
  },
  horizontal: {
    flexDirection: 'row',
    justifyContent: 'space-around',
    padding: 10,
  },
});

export default App;

Reference

Props

Inherits View Props.


animating

Whether to show the indicator (true) or hide it (false).

Type Default
bool true

color

The foreground color of the spinner.

Type Default
color null (system accent default color)
Android

<ins style={{background: '#999'}} className="color-box" />'#999999'
iOS

hidesWhenStopped
iOS

Whether the indicator should hide when not animating.

Type Default
bool true

ref

A ref setter that will be assigned an element node when mounted.


size

Size of the indicator.

Type Default
enum('small', 'large')
number
Android
'small'