Home » React Native ActivityIndicator

React Native ActivityIndicator

by Online Tutorials Library

React Native ActivityIndicator

ActivityIndicator is used to display a circular loading indicator.

Props

PropsDescription
animatingOption to show the indicator (bydefault it is true) or hide it (false).
sizeSet the size of indicator (‘small’,’large’, number). The default size is small. Number format support only in android.
colorSet the foreground color of the spinner (default is gray).
hidesWhenStoppedIt provides an option to show or hide the indicator when there is no animating (true by default).

React Native ActivityIndicator Example

In this example, the animating property set the activity indicator to true, and it is visible on the screen. When the component mounts, the animated activity indicator will be closed after six seconds using the closeActivityIndicator() method.

Output:

React Native ActivityIndicator


You may also like