Skeleton

Skeleton is an animated skeleton component for React Native and React, from the dissolve library. Loading placeholders that break into grains and recompose into the real content, block by block.

Loading placeholders that do not just crossfade. While loading, a calm wave of light rolls across the blocks, top left to bottom right. When loading turns false, every placeholder breaks into grains and those same grains recompose the real content, block by block in reading order (about 70 ms apart, compressed so the whole handoff stays under 900 ms), with one light haptic as the first grains land. The content shows exactly where its grains land. You describe the placeholders and keep your content: wrap each piece in SkeletonBlock with its shape while loading, a line (a rounded bar centered in its line height, lines for a paragraph), a circle (an avatar) or a rect (an image, a card). Children only render once loading is false, so they can read data that is not there yet. Reduced motion: no wave, a short crossfade.

Install

React Native

Install the engine once per app and wrap the root layout in <DissolveProvider> (see Installation), then copy the component into components/dissolve:

npx expo install dissolve-ui @shopify/react-native-skia react-native-reanimated react-native-worklets react-native-gesture-handler expo-haptics
npx dissolve-ui add skeleton --native
npx shadcn@latest add https://dissolve.rselmi.com/r/native/skeleton.json

React

Needs React 19 and react-dom, nothing else: no engine, no provider, no Tailwind. Works in the Next.js App Router.

npx dissolve-ui add skeleton --web
npx shadcn@latest add https://dissolve.rselmi.com/r/skeleton.json

Usage

Skeleton.tsx (React Native)
import { Skeleton, SkeletonBlock } from '@/components/dissolve/skeleton';

<Skeleton loading={!user}>
  <View className="flex-row items-center gap-4">
    <SkeletonBlock shape="circle" size={64}>
      <Image source={user?.avatar} style={{ width: 64, height: 64, borderRadius: 32 }} />
    </SkeletonBlock>
    <View className="flex-1 gap-1">
      <SkeletonBlock width={160} height={25}>
        <Text className="text-[20px] font-semibold">{user?.name}</Text>
      </SkeletonBlock>
      <SkeletonBlock width={96}>
        <Text className="text-[15px] text-dissolve-muted">{user?.handle}</Text>
      </SkeletonBlock>
    </View>
  </View>
</Skeleton>

// The dotted form, a cover and a paragraph.
<Skeleton loading={loading} stagger={80} onReveal={() => track('feed_shown')}>
  <Skeleton.Block shape="rect" height={180} radius={20}>
    <Cover post={post} />
  </Skeleton.Block>
  <Skeleton.Block lines={3} height={22} className="mt-3">
    <Text>{post?.body}</Text>
  </Skeleton.Block>
</Skeleton>
Skeleton.tsx (React)
import { Skeleton, SkeletonBlock } from '@/components/dissolve/skeleton';

<Skeleton loading={!user}>
  <div className="flex items-center gap-4">
    <SkeletonBlock shape="circle" size={64}>
      <img src={user?.avatar} alt="" width={64} height={64} className="rounded-full" />
    </SkeletonBlock>
    <div className="flex flex-1 flex-col gap-1">
      <SkeletonBlock width={160} height={25}>
        <span className="text-[20px] font-semibold">{user?.name}</span>
      </SkeletonBlock>
      <SkeletonBlock width={96}>
        <span className="text-[15px] text-dissolve-muted">{user?.handle}</span>
      </SkeletonBlock>
    </div>
  </div>
</Skeleton>

// The dotted form, a cover and a paragraph.
<Skeleton loading={loading} stagger={80} onReveal={() => track('feed_shown')}>
  <Skeleton.Block shape="rect" height={180} radius={20}>
    <Cover post={post} />
  </Skeleton.Block>
  <Skeleton.Block lines={3} height={22} className="mt-3">
    <p>{post?.body}</p>
  </Skeleton.Block>
</Skeleton>

Props

PropTypeDefaultDescription
loadingbooleanrequiredTrue shows the placeholders. False hands every block over to its content in grains.
childrenReactNoderequiredAny layout, with SkeletonBlocks anywhere inside it.
shimmerbooleantrueWave of light across the blocks while loading. Off under reduced motion.
color'surface' | 'surface-2' | 'border''surface'Placeholder fill as a theme token.
staggernumber70Delay between two blocks in ms, in reading order. Compressed with many blocks so the handoff stays under about 900 ms.
durationnumber600Duration of one block's handoff in ms.
grainnumber3Grain size in points.
hapticsbooleantrueOne light impact as the first grains land.
onReveal() => voidCalled once every block shows its content.
className / stylestring / ViewStyleRoot classes and style.
SkeletonBlock{ shape?, width?, height?, size?, radius?, lines?, className?, style? }Wraps one piece of content. shape: 'line' (default, a bar 0.6 of height, height default 20), 'circle' (size across, default 40) or 'rect' (width by height, default 100% by 120, radius 12). lines stacks bars for a paragraph. className restyles the placeholder, style goes to the outer box. Also available as Skeleton.Block.

Source

Previous: ScratchCard · Next: SegmentedControl · All components

dissolve is MIT licensed. Source on GitHub, package on npm. This page as markdown. For AI agents: llms.txt.