When to use it
Use a pressable attachment to open the file with the platform viewer.
Native example
Use a pressable attachment to open the file with the platform viewer.
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)
}
)
}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