Primitive
AsyncImage
Auto-emitted from DSKintsugiCatalog.asyncimage. Tier atom.
Live Preview
portrait.jpg
Failed to load
Native · macOS
DSL usage
// Default — cover fit, automatic cache, cross-fade transition katagami.asyncimage( url: URL(string: "https://cdn.example.com/portrait.jpg")!, fit: .cover ) // With custom placeholder and contain fit katagami.asyncimage( url: URL(string: "https://cdn.example.com/banner.jpg")!, placeholder: katagami.image(asset: "placeholder-banner", fit: .cover), fit: .contain, cachePolicy: .returnCacheDataElseLoad, transition: .opacity(duration: 0.25) ) // Error state handled by the runtime; no explicit .error case needed // unless overriding the fallback view.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
url |
URL | |
Remote URL of the image to load asynchronously |
placeholder |
ViewNode? | nil |
Optional node shown while loading; shimmer used when nil |
fit |
ImageFit | .cover |
.cover | .contain | .fill — maps to CSS object-fit |
cachePolicy |
URLRequest.CachePolicy | .useProtocolCachePolicy |
URL cache strategy; .returnCacheDataElseLoad recommended for feeds |
transition |
AsyncImageTransition | .opacity(0.2) |
Cross-fade transition applied when the remote image finishes loading |
density |
Density | regular |
compact | regular | expanded |
locale |
Locale | en |
BCP-47 locale tag for locale-aware rendering |
Used in
KatagamiScreens sigma-analytics c-tech