Animated Empty States

Animated Empty States

A reusable empty state with three presets (No results, Offline, Inbox zero), each with a looping illustration layered from SF Symbols: a sweeping magnifier, pulsing Wi-Fi waves, a looping paper plane. Switching presets blurs the artwork across and morphs the copy, and the loops pause under Reduce Motion.

Luiz Mello
  • empty
  • animation
  • state

snippet.swift362 lines

4 files • Scroll to see all →
/// Which looping illustration an empty state plays.public enum AnimatedEmptyStateIllustration: String, Hashable, CaseIterable {    /// A magnifier sweeping over a stack of blank cards.    case search    /// A wifi glyph whose waves pulse out over radar rings.    case offline    /// A paper plane looping over an empty tray.    case inbox}​/// Copy, artwork and color for one `AnimatedEmptyState`.public struct AnimatedEmptyStateContent: Identifiable, Hashable {    public var id: String { title }    public let illustration: AnimatedEmptyStateIllustration    public let title: String    public let message: String    public let actionTitle: String    public let actionImage: String    public let tint: Color​​// ... (click "Show full code" to see more)
Viewing: Model.swift•1 of 4