When to use it
Use a pressable attachment to open the file with the platform viewer.
Apple availability
Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.
Native example
Use a pressable attachment to open the file with the platform viewer.
import LumenUI
import SwiftUI
struct AttachmentExample: View {
var body: some View {
VStack(spacing: LumenSpacing.md) {
LumenAttachment("Quarterly report.pdf", meta: "PDF · 2.4 MB", action: {}) {
LumenIconButton(name: .download, label: "Download Quarterly report.pdf", size: .sm) {}
}
LumenAttachment("Launch photo.heic", meta: "Uploading · 64%", icon: .image, busy: true) {
LumenIconButton(name: .x, label: "Cancel upload", size: .sm) {}
}
}
}
}Reference
The primary shared and platform-specific options exposed by LumenAttachment.
| API | Values or type | Default | Description |
|---|---|---|---|
| name / meta / busy | filename / size or type / upload state | required / none / false | Use a pressable attachment to open the file with the platform viewer. |
Native behavior
Use a pressable attachment to open the file with the platform viewer.
Filename and metadata read as one element; busy state is exposed.
Shared component