Autumn Sale50% offCOMPOT
Developer Templates & ArchitectureFree ComponentiOS 16.0+Xcode 15+

Content Unavailable View Template

Standard empty state template with icon, title, description, and action button.

SwiftUI Implementation

Pure Vanilla Swift • No Dependencies
ContentUnavailableViewTemplate.swift
import SwiftUI

struct ContentUnavailableViewTemplate: View {
    @State private var toggleButton = false

    var body: some View {
        ContentUnavailableView {
            VStack(spacing: 16) {
                Image(systemName: "folder.badge.plus")
                .font(.title)
                Text("No items")
            }
        } description: {
            Text("This folder is empty. Start building your library by adding a new item.")
            .multilineTextAlignment(.center)
            .frame(maxWidth: 450)
        } actions: {
            Button(
                "Add New",
                systemImage: "plus",
                action: { toggleButton.toggle() }
            )
            .symbolEffect(.bounce, value: toggleButton)
            .buttonRepeatBehavior(.enabled)
        }
    }
}

#Preview {
    ContentUnavailableViewTemplate()
}

Ready to copy and paste directly into any Xcode project running iOS 16.0+.

Recommended Use Cases

  • Integrating into standard iOS placeholder workflows
  • Polishing app UI with native iOS system styling
  • Speeding up custom SwiftUI screen development

Component Details

iOS Compatibility
iOS 16.0+
Xcode Version
Xcode 15+
Platform
iOS
License Tier
Free
Themes & Contexts
list
Keywords
contentunavailabletemplate
C

Compot for iOS

Native SwiftUI playground app

Preview all 130+ components interactively on your device and copy code straight to Xcode with 1 tap.

Get Compot on the App Store