Feedback/DSSkeleton

DSSkeleton

feedback
since v1.0

Pulsing placeholder shapes that mimic the layout of content while it loads.

iOS 17+macOS 14+

Purpose

Reduce perceived loading time and layout shift. Use instead of a spinner whenever the layout is known.

Interactive Reference

Live showroom

Need the full visual surface?

Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().

Best for exploring:

variants, states, categories, and real app examples in one place.

Props

PropTypeDefaultDescription
widthCGFloat?nilFixed width. nil = full width.
heightreqCGFloatโ€”Shape height.
radiusCGFloatDSRadius.smallCorner radius.

Examples

Card skeleton

Placeholder matching a content card layout.

swift
DSSkeletonCard()  // pre-built card placeholder

// Or custom layout:
VStack(alignment: .leading, spacing: DSSpacing.sm) {
    DSSkeleton(height: 16, radius: DSRadius.small)          // title
    DSSkeleton(width: 120, height: 12, radius: DSRadius.small) // subtitle
}

Related Components