Let's people know that your app isn't stalled while it loads content or performs lengthy operations.
import { Icon } from '@roninoss/icons';
import { Stack } from 'expo-router';
import { View, Text, ScrollView, Pressable } from 'react-native';
import { ActivityIndicator } from '~/components/nativewindui/ActivityIndicator';
import { useColorScheme } from '~/lib/useColorScheme';
export default function ActivityIndicatorScreen() {
const { colors } = useColorScheme();
return (
<>
<Stack.Screen
options={{
title: 'NativeWindUI',
headerSearchBarOptions: {
hideWhenScrolling: false,
},
headerLargeTitle: true,
headerRight() {
return (
<Pressable className="opacity-80 active:opacity-40">
<View className="opacity-90">
<Icon name="cog-outline" color={colors.foreground} />
</View>
</Pressable>
);
},
}}
/>
<ScrollView contentInsetAdjustmentBehavior="automatic" className="p-4">
<View className="border-border bg-card gap-4 rounded-xl border p-4 pb-6 shadow-sm shadow-black/10 dark:shadow-none">
<Text className="text-foreground text-center text-sm font-medium tracking-wider opacity-60">
Activity Indicator
</Text>
<View className="p-4">
<ActivityIndicator />
</View>
</View>
</ScrollView>
</>
);
}
npx nwui-cli@latest add activity-indicator
import { ActivityIndicator } from '~/components/nativewindui/ActivityIndicator';
<ActivityIndicator />
Inherits all the props from React Native's Activity Indicator component.