Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Apple docs
Data displayApple

Attachment

Show a file with its name, metadata, and actions.

Public APILumenAttachmentApple / SwiftUISwift product: LumenUI

Apple availability

Supported native targets

Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.

iPhone · iOS 16+iPad · iPadOS 16+Mac · macOS 13+Apple TV · tvOS 16+Apple Vision · visionOS 1+Apple Watch · watchOS 9+

Native example

Use Attachment

Use a pressable attachment to open the file with the platform viewer.

Attachment rendered in the iPhone simulator Lumen playground
Captured exampleiPhone simulatorView dark appearance
swift
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) {}
            }
        }
    }
}
Apple
A pressable file row with a download action and an image upload in progress.

Reference

Public API

The primary shared and platform-specific options exposed by LumenAttachment.

APIValues or typeDefaultDescription
name / meta / busyfilename / size or type / upload staterequired / none / falseUse a pressable attachment to open the file with the platform viewer.

Native behavior

Design and accessibility

When to use it

Use a pressable attachment to open the file with the platform viewer.

Accessibility

Filename and metadata read as one element; busy state is exposed.

Shared component

Available on other platforms

React NativeAndroid / Compose Web
Apple docsSwiftUI package