Introducing AlienX extension – The next evolution of UI development.Check it out on VS Code
Enjoy AlienUI? Give it a star on Github ⭐
A customizable spinner that provides visual feedback during processing.
A default spinner for loading state changes.
import React from "react";
import { View } from "react-native";
const Spinner = () => {
return (
<View className="flex items-center justify-center">
<View className="h-12 w-12 border-4 border-black border-t-transparent rounded-full animate-spin" />
</View>
);
};
export default Spinner;
import React from "react";
import { View } from "react-native";
import Spinner from "./components/Spinner/GalaxySpinner";
const App = () => {
return (
<View>
<Spinner />
</View>
);
};
export default App;
A spherical earth-shaped loader that changes color while loading.
import React, { useState, useEffect } from "react";
import { View } from "react-native";
const Spinner = () => {
const [currentColor, setCurrentColor] = useState("bg-black");
useEffect(() => {
const colors = [
"bg-black",
"bg-red-500",
"bg-blue-500",
"bg-green-500",
"bg-yellow-500",
];
let index = 0;
const interval = setInterval(() => {
setCurrentColor(colors[index]);
index = (index + 1) % colors.length;
}, 500);
return () => clearInterval(interval);
}, []);
return (
<View className="flex items-center justify-center">
<View className={`w-12 h-12 ${currentColor} rounded-full animate-spin`} />
</View>
);
};
export default Spinner;
import React from "react";
import { View } from "react-native";
import Spinner from "./components/Spinner/EarthSpinner";
const App = () => {
return (
<View>
<Spinner />
</View>
);
};
export default App;