BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/tetra-ui/skeleton

Skeleton

tetra-ui/skeleton
FreeComponent

A component to display placeholder content while in a loading state.

Live preview

live · rendered by the registry
Rendered by tetra-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://tetra-ui.com/r/skeleton.json

Source

ui/skeleton.tsxtetra-ui.com/r/skeleton.json
1import { createContext, useContext, useEffect, useMemo } from "react";
2import Animated, {
3 type SharedValue,
4 useAnimatedStyle,
5 useSharedValue,
6 withRepeat,
7 withTiming,
8} from "react-native-reanimated";
9import { cn } from "@/lib/utils";
10
11// Constants
12const ANIMATION_DURATION = 1000;
13const MIN_OPACITY = 0.4;
14const MAX_OPACITY = 1;
15
16// Types
17type InternalSkeletonGroupContextType = {
18 opacity: SharedValue<number>;
19};
20
21type SkeletonGroupProps = {
22 children: React.ReactNode;
23};
24
25type SkeletonProps = React.ComponentProps<typeof Animated.View>;
26
27// Context
28const SkeletonGroupContext =
29 createContext<InternalSkeletonGroupContextType | null>(null);
30
31const useSkeletonGroupContext = () => useContext(SkeletonGroupContext);
32
33// Components
34export const SkeletonGroup = ({ children }: SkeletonGroupProps) => {
35 const opacity = useSharedValue(MIN_OPACITY);
36
37 useEffect(() => {
38 opacity.value = withRepeat(
39 withTiming(MAX_OPACITY, { duration: ANIMATION_DURATION }),
40 -1,
41 true
42 );
43 }, [opacity]);
44
45 const ctx = useMemo(() => {
46 return {
47 opacity,
48 };
49 }, [opacity]);
50
51 return (
52 <SkeletonGroupContext.Provider value={ctx}>
53 {children}
54 </SkeletonGroupContext.Provider>
55 );
56};
57
58export const Skeleton = ({ className, ...props }: SkeletonProps) => {
59 const groupContext = useSkeletonGroupContext();
60 const localOpacity = useSharedValue(MIN_OPACITY);
61 const opacity = groupContext?.opacity ?? localOpacity;
62
63 useEffect(() => {
64 if (groupContext) {
65 return;
66 }
67
68 localOpacity.value = withRepeat(
69 withTiming(MAX_OPACITY, { duration: ANIMATION_DURATION }),
70 -1,
71 true
72 );
73 }, [groupContext, localOpacity]);
74
75 const animatedStyle = useAnimatedStyle(() => {
76 return {
77 opacity: opacity.value,
78 };
79 });
80
81 return (
82 <Animated.View
83 className={cn("w-full rounded-md bg-accent", className)}
84 data-slot="skeleton"
85 style={animatedStyle}
86 {...props}
87 />
88 );
89};

What it pulls in

npm packages

  • react-native-reanimated

Files it writes

  • ui/skeleton.tsx

Facts

Registry
tetra-ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
today

Go to the source

Docs on tetra-ui tetra-ui.com Liamandrew/tetra-ui on GitHub Raw registry item This item as JSON

More from tetra-ui

All 41 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordiontetra-uiComponentsFree1 dep
Action Inputaction-inputtetra-uiComponentsFreeno deps
Alertalerttetra-uiComponentsFreeno deps
Avataravatartetra-uiComponentsFreeno deps
Badgebadgetetra-uiComponentsFreeno deps
Bottom Sheetbottom-sheettetra-uiComponentsFree4 deps · 7 files
Buttonbuttontetra-uiComponentsFreeno deps
Cardcardtetra-uiComponentsFreeno deps
BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex