Skip to content

Instantly share code, notes, and snippets.

@farynaio
Created August 16, 2024 22:14
Show Gist options
  • Save farynaio/f8c24e69e7b400f9be548475c72f5cd1 to your computer and use it in GitHub Desktop.
Save farynaio/f8c24e69e7b400f9be548475c72f5cd1 to your computer and use it in GitHub Desktop.
RN LoadingIndicator made with @motify/components
import { FC } from "react"
import { MotiView } from "@motify/components"
const LoadingIndicator: FC<{ size: number }> = ({ size }) => {
return (
<MotiView
from={{
width: size,
height: size,
borderRadius: size / 2,
borderWidth: 0,
shadowOpacity: 0.5,
}}
animate={{
width: size + 20,
height: size + 20,
borderRadius: (size + 20) / 2,
borderWidth: size / 10,
shadowOpacity: 1,
}}
transition={{
type: "timing",
duration: 1000,
loop: true,
}}
style={{
width: size,
height: size,
borderRadius: size / 2,
borderWidth: size / 10,
borderColor: "#fff",
shadowColor: "#fff",
shadowOffset: { width: 0, height: 0 },
shadowOpacity: 1,
shadowRadius: 10,
}}
/>
)
}
export default LoadingIndicator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment