SwipeUI

Skeleton

Token placeholder shimmer with reduced-motion, background and viewport pause.

npx @swipeui/cli add skeleton
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When to use it

  • Placeholders while a feed, profile or card loads, shaped like the content to come.
  • Avoiding layout jumps by reserving space for text and images.
  • Text lines, circles for avatars and rectangles for media.

When not to use it

  • Very quick loads under half a second; it adds flicker.
  • Actions that are processing. Use a button's loading state.
  • Empty results. Use Empty state.

Installation

Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.

npx @swipeui/cli add skeleton
  • Adds components/swipeui/ui/skeleton.tsx and 4 shared helpers.
  • Installs react-native-reanimated, react-native-worklets, uniwind, clsx, tailwind-merge. In Expo apps it uses npx expo install so versions match your SDK.

Usage

app/(tabs)/index.tsx
import { Skeleton } from '@/components/swipeui/ui/skeleton';

<Skeleton height={24} />;

Examples

Use the variant and appearance controls in the live specimen to compare the documented states. The application owns validation, operation results and persistence.

API reference

SkeletonProps

PropTypeDefaultDescription
width?number | `${number}%`—

Intrinsic placeholder width; otherwise fills its parent.

height?number16

Intrinsic placeholder height.

variant?"circle" | "rectangle" | "text"'rectangle'

Shape.

active?booleantrue

Caller viewability/navigation override.

motion?MotionOverride—

Shared ambient feel.

className?string—

Root classes.

style?StyleProp<ViewStyle>—

Native layout escape hatch.

testID?string—

Root ID.

Native view/input props not listed here pass through where the exported TypeScript type allows them.

Composition and behavior

  • variant is rectangle, circle or text; width and height set the size.
  • active pauses the shimmer, for example when a screen isn't focused.

Feedback lineup settings

PropDoes / default
widthIntrinsic placeholder width; otherwise fills its parent.
heightIntrinsic placeholder height. @default 16
variantShape. @default 'rectangle'
activeCaller viewability/navigation override. @default true
motionShared ambient feel.
classNameRoot classes.
styleNative layout escape hatch.
testIDRoot ID.
presetContent layout. @default 'profile'
appearanceOptional card surface. @default 'elevated'
labelSpoken loading purpose. @default 'Loading content'

The loading recipes match the finished shared specimens: a named designer profile with a naturally wrapping, fuller work bio and founder-supplied Instagram, LinkedIn and X logos; a creator feed with host-supplied music-player art; full-name collaborators with distinct roles; and weekly activity with a rising trend and animated goal progress. These are specimen contents, not data or assets shipped by the Skeleton primitive.

The feed keeps the whole supplied image inside an explicit 2:1 rounded frame on both hosts. Like fills vivid red, Save fills sky blue and Repost highlights green; Comment shows a “Comment clicked” pill toast. These local interactions demonstrate finished content without changing Skeleton loading behavior.

Behavior and gestures

  • Static; a soft shimmer sweeps across while it's on screen.
  • The shimmer pauses when it scrolls off screen, the app goes to the background or active is false.

Accessibility

  • Hidden from screen readers; announce loading separately if needed, for example with a Spinner label.
  • Reduce Motion removes the shimmer and shows a still placeholder.

Motion

  • Uses the ambient motion role, so it follows your app's feel. Pass motion to tune this one instance.
  • The sweep uses the ambient role.
  • Reduce Motion turns it off.

Performance

  • The shimmer stops when not visible, so long lists of skeletons stay light.

Notes for AI

  • Match the real layout's sizes so nothing jumps when content arrives.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items