ContentUnavailableView(props: {
title?: string | Component;
systemImage?: string;
description?: string | Component;
label?: Component;
}): Component;
ContentUnavailableView(props: {
title?: string | Component;
systemImage?: string;
description?: string | Component;
label?: Component;
}, children: Component[]): Component;
The main title text. Can be a plain string or a styled component.
A system symbol name (SF Symbols) displayed as a large icon above the title.
Descriptive text shown below the title. Can be a plain string or a styled component.
A custom label component replacing the default title + icon layout.
Optional action buttons or additional content displayed below the description.
Support
Usage
Empty search results
ContentUnavailableView({
title: "No Results",
systemImage: "magnifyingglass",
description: "Try a different search term."
})
No content state
ContentUnavailableView({
title: "No Photos",
systemImage: "photo.on.rectangle",
description: "Photos you take will appear here."
})
ContentUnavailableView({
title: "No Internet Connection",
systemImage: "wifi.slash",
description: "Check your connection and try again."
}, [
Button("Retry", () => refresh())
])
Custom label
ContentUnavailableView({
label: VStack([
Image({ systemName: "folder" })
.foregroundStyle(Color("gray"))
.imageScale("large"),
Text("No Documents")
.font("title2")
]),
description: "Create a new document to get started."
}, [
Button("New Document", () => createDocument())
])
See Also