suiss/uim · React Native Component

Skeleton

A pulsing placeholder shape shown while content loads.

Skeleton is an open-source mobile component from suiss/uim for React Native and Expo, with SwiftUI and Jetpack Compose versions built from the same design tokens. The @esuiss/uim CLI copies its source into your project, so you own the code.

iOS
Skeleton on iOS in light mode

Skeleton is a Reanimated View with a rounded background whose opacity pulses between 1 and 0.5 on a loop. It has no fixed size; you shape it with classes to match the content it stands in for.

Installation

$ pnpm dlx @esuiss/uim@latest add skeleton

Manual

  1. Install the dependencies:
npx expo install cn react-native-reanimated react-native-worklets
  1. Copy the source into components/ui/skeleton.tsx:
uniwind/components/ui/skeleton.tsx
import { cn } from "cn"
import * as React from "react"
import type { View } from "react-native"
import Animated, {
  useAnimatedStyle,
  useSharedValue,
  withRepeat,
  withTiming,
} from "react-native-reanimated"

const duration = 1000

function Skeleton({
  className,
  ...props
}: React.ComponentProps<typeof View> & React.RefAttributes<View>) {
  1. Update the import paths to match your project.

Usage

import { Skeleton } from "@/components/ui/skeleton"
<Skeleton className="h-4 w-48" />

Set width, height and radius through className, for example h-4 w-48 for a line of text or size-12 rounded-full for an avatar. Compose several skeletons to mirror the layout of the loaded content, then swap them for the real content once it arrives.

Examples

Profile

An avatar circle with two lines of text.

iOS
Skeleton (profile) on iOS in light mode

Card

A media block with two lines of text below it.

iOS
Skeleton (card) on iOS in light mode

List

Rows with a thumbnail and two lines of text.

iOS
Skeleton (list) on iOS in light mode

API Reference

Skeleton

ExtendsReact.ComponentProps<typeof View>React.RefAttributes<View>

Accessibility

  • The skeleton is a plain view with no role or label. If loading state matters to the user, announce it elsewhere, for example with a Spinner that has an accessibilityLabel.

Notes

  • Uses the bg-surface-secondary token.
  • The pulse runs on the UI thread through Reanimated, with a 1000 ms cycle.
  • Light and dark colors follow the system appearance.