Docs
Feedback

Skeleton Loader

Placeholder bones and a modifier that turns any layout into one sweeping shape, then hands off as the content rises in.

$npx swiftpieces add SkeletonLoader
See it in a Pro app On a real screen in one of the Pro apps: open it with Pro, take it apart, remix it, and copy the SwiftUI.
Free · MIT + Commons ClauseiOS 17.0+loadingskeletonshimmerplaceholdererrorredacted
Type
SkeletonLoader
Files
SkeletonLoader.swift
Depends on
Nothing (Apple frameworks only)
Version
2.2.0
In a full screen · SwiftPieces ProProjectsA projects screen that starts as breathing ghost rows and hands off to your real projects.

Standalone placeholder bone. Use .skeleton(isLoading:) to redact real content instead. Bones stand in for content, not chrome, so they stay solid in the liquid glass language: glass is for the controls that load around them.

Notes

  • .skeleton(isLoading:) keeps the real view in the tree, hidden, so layout never jumps. The placeholder is a silhouette of the redacted view drawn through an alpha threshold, so text bars, color blocks and symbols all become one solid bone color, whatever colors the content uses.
  • A soft diagonal light passes over the bones, easing in and out, then rests before the next pass. Every instance reads the same reference clock, so passes start on the same beat. Bones and rows are crossed edge to edge in the first three quarters of period, so they are lit in the same moments whatever their width. Larger surfaces, up to a whole screen, stretch their pass toward nine tenths of period to keep the light calm, so it runs only a little quicker than a row's and rests less.
  • On handoff the placeholder lifts away first on a quick, firm fade, and 50 ms later the content surfaces behind it, unblurring and rising 6 pt on a calm spring with no visible overshoot, so the two barely overlap out of register. staggerIndex delays each row's handoff by 60 ms per index so lists reveal top to bottom. Turning loading back on covers every row at once.
  • isFailed stops the sweep and dims the bones firmly so the slot reads as empty; flip isLoading back on to retry, and the bones brighten as the light returns.
  • Style sets the bone fill, the sweep highlight, the period and the failed opacity, with house palette defaults that adapt to light and dark. Pass the same style to SkeletonLoader bones and .skeleton so they match.
  • Under Reduce Motion the light holds still and every bone breathes slowly toward the highlight and back in unison, over two periods, so the slot still reads as loading. The handoff is a short crossfade with no blur, rise or stagger, so the slot never flashes empty.
  • Reduce Transparency switches to an opaque fill without the sweep or the breath.
  • Bones stand in for content, not chrome, so they stay solid rather than liquid glass: glass is for the controls that load around them. The example rows are semibold throughout, like every string in the library.
  • For a whole projects screen that starts as ghost rows and hands off to real content, see the Pro Projects screen.

Usage

SkeletonLoaderExample()

Parameters

ParameterDescription
shape.rounded(radius), .circle, .capsule, or .text(lines:) for a stack of text lines with a shorter last line.
isFailedStops the sweep and dims the bone so the slot reads as empty.
styleBone and highlight colors and the sweep period. .standard is a solid warm grey that adapts to light and dark.

Install

Pick one. Run it from the folder that contains your .xcodeproj and the files land inside your app.

Terminal

$npx swiftpieces add SkeletonLoader

Or ask your coding agent · Claude Code, Cursor or Xcode, once the MCP server is connected

>Add the SwiftPieces "Skeleton Loader" piece to my app

Or copy the source above into your app.

New to SwiftUI?If you know React, CSS or Tailwind, SwiftUI is easier to pick up than it looks.Try real app patterns first

Building a whole app? See SwiftPieces Pro →

All feedback →

Build it yourself: SwiftUI loading states guide · SwiftUI haptics guide

On this page

SwiftPiecesPro

Build the whole app with one library.

Production-ready screens, whole flows, complete app templates, a Build Kit your agent follows and Pro remixing.

54 screens · 46 patterns · 48 flows · 12 templates · 31 Build Kit skills

Explore Pro