Skip to main content

ActivityIndicator

An extension of the React Native ActivityIndicator component with extension of visible and label props. This shows the native loader for both android & iOS.

Usage

function ActivityIndicatorUsage() {
return (
<View>
<ActivityIndicator />
</View>
)
}

Status

function ActivityIndicatorStatuses() {
return (
<View row style={{justifyContent: 'space-evenly'}}>
<ActivityIndicator status="primary" />
<ActivityIndicator status="accent" />
<ActivityIndicator status="success" />
<ActivityIndicator status="info" />
<ActivityIndicator status="warning" />
<ActivityIndicator status="error" />
</View>
)
}

Size

small
medium
large
function ActivityIndicatorSizes() {
return (
<View row style={{justifyContent: 'space-evenly'}}>
<ActivityIndicator size="small" label="small" />
<ActivityIndicator size="medium" label="medium" />
<ActivityIndicator size="large" label="large" />
</View>
)
}

Custom

Loading...
Fetching your data...
function ActivityIndicatorCustom() {
return (
<View row style={{justifyContent: 'space-evenly'}}>
<ActivityIndicator color="green" size={40} label="Loading..." />
<ActivityIndicator
color="cyan"
size={80}
label="Fetching your data..."
labelStyle={{fontSize: 18}}
/>
</View>
)
}

Props

PropData TypeDefault ValueDescription
ExtendsOmit<ActivityIndicatorProps$1, 'size'>--Inherits properties from Omit<ActivityIndicatorProps$1, 'size'>
visiblebooleantrueSet to false to hide it
sizenumber | BlossomSizemediumControl the size using pre-defined options
labelstring--Label text below indicator
labelStyleStyleProp<TextStyle>--Label text style
containerStyleStyleProp<ViewStyle>--Container style wrapping both label and ActivityIndicator