Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Android docs
Data displayAndroid

Attachment

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

Public APILumenAttachmentAndroid / Compose

Native example

Use Attachment

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

Attachment rendered in the Android phone emulator Lumen playground
Captured exampleAndroid phone emulatorView dark appearance
kotlin
import androidx.compose.runtime.*
import com.santi020k.lumen.*

@Composable
fun ReportAttachment() {
    var uploading by remember { mutableStateOf(true) }
    LumenAttachment(
        name = "Quarterly report.pdf",
        meta = if (uploading) "Uploading · 68%" else "2.4 MB · PDF",
        icon = LumenIconName.FileText,
        busy = uploading,
        onClick = { uploading = false },
        trailing = {
            LumenIconButton(LumenIconName.Download, "Download Quarterly report.pdf", onClick = {}, size = LumenControlSize.Sm)
        }
    )
}
Android
A file row with a leading file icon, its size, a download action, and a busy upload sweep.

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 NativeApple / SwiftUI Web
Android docsCompose module