Version: 0.63

ActivityIndicator

Displays a circular loading indicator.

Example

import React from "react";
import { ActivityIndicator, StyleSheet, Text, View } from "react-native";
const App = () => (
<View style={[styles.container, styles.horizontal]}>
<ActivityIndicator />
<ActivityIndicator size="large" />
<ActivityIndicator size="small" color="#0000ff" />
<ActivityIndicator size="large" color="#00ff00" />
</View>
);
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center"
},
horizontal: {
flexDirection: "row",
justifyContent: "space-around",
padding: 10
}
});
export default App;
import React, { Component } from "react";
import { ActivityIndicator, StyleSheet, Text, View } from "react-native";
class App extends Component {
render() {
return (
<View style={[styles.container, styles.horizontal]}>
<ActivityIndicator />
<ActivityIndicator size="large" />
<ActivityIndicator size="small" color="#0000ff" />
<ActivityIndicator size="large" color="#00ff00" />
</View>
);
}
}
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).

TypeRequiredDefault
boolNotrue

color

The foreground color of the spinner.

TypeRequiredDefault
colorNonull (system accent default color)
Android

'#999999'
iOS

hidesWhenStopped
iOS

Whether the indicator should hide when not animating.

TypeRequiredDefault
boolNotrue

size

Size of the indicator.

TypeRequiredDefault
enum('small', 'large')
number
Android
No'small'