Skip to content
skeleton-example.tsx
Use to show a placeholder while content is loading.

Installation#
bunx --bun fabricator-ui@latest add skeleton
Usage#
import { Skeleton } from "@/components/ui/skeleton"<Skeleton className="size-12 rounded-full" />
<View className="flex-1 gap-2">
<Skeleton className="h-4 w-3/4" />
<Skeleton className="h-4 w-1/2" />
</View>Examples#
import { View } from "react-native"
import { Skeleton } from "@/components/ui/skeleton"
function SkeletonExample() {
return (
<ExampleWrapper>
<Example title="Avatar and text" className="flex-row items-center">
<Skeleton className="size-12 rounded-full" />
<View className="flex-1 gap-2">
<Skeleton className="h-4 w-3/4" />
<Skeleton className="h-4 w-1/2" />
</View>
</Example>
<Example title="Card" className="items-stretch">
<Skeleton className="h-32 w-full rounded-xl" />
<Skeleton className="h-4 w-2/3" />
<Skeleton className="h-4 w-1/2" />
</Example>
</ExampleWrapper>
)
}
export { SkeletonExample }Differences from web#
Same. It works as it does on the web, with onPress for onClick.
Accessibility#
Text is read as it appears. Give a control with no text an accessibilityLabel.