Skip to content
ghostui

Attachment

Recognize a file and take the action available in its current context.

Preview

briefing-notes.pdf
workspace.jpg
message-renderer.tsx
workspace-notes.csv

Usage

Anatomy

Attachment contains caller-owned media, a filename, honest human-readable metadata, and only the actions supported by the file state. AttachmentGroup owns horizontal scrolling, snapping, keyboard reach and conditional edge fades. AttachmentList remains the semantic vertical-list composition.

Examples

Horizontal group

Review mixed selected files in a compact horizontal group. The first file is complete and the remaining files are reachable by horizontal scroll and keyboard focus.

briefing-notes.pdf
workspace.jpg
message-renderer.tsx
workspace-notes.csv

Small row

Use a compact row when the file sits above a composer. The completed name, known metadata, and Remove action stay on one line; the full filename remains available as the title.

briefing-notes.pdf

Small group

Review draft files in a compact, horizontally scrollable group. Draft files include a working Remove action; the group collapses when the final file is removed.

briefing-notes.pdf
workspace.jpg
message-renderer.tsx
workspace-notes.csv

Sent files

Read files already attached to a sent message. Sent files do not inherit draft removal controls.

briefing-notes.pdf
workspace.jpg
message-renderer.tsx
workspace-notes.csv

Image references

Review image references with large previews. Open the filename to view the actual local image.

workspace.jpg
desk.jpg
office.jpg

File row

Open a real host target through the filename or remove the file independently.

briefing-notes.pdf

Uploading

Inspect bounded progress or indeterminate upload activity and cancel it when needed.

receipt-upload.pdf
Uploading · 0%
x

Failed

Read the single-line failure reason, then retry or remove the file independently. The failed card uses the semantic danger surface and border; the complete reason remains available from its accessible name and title.

receipt-error.pdf
The receipt could not be uploaded because the workspace is full.

Long and unknown names

Keep a long filename readable and omit metadata that is not known.

receipt-details-from-the-invoice-export-with-the-original-customer-reference.csv
receipt-export.bin

API

Accessibility

Use a meaningful filename. Give AttachmentGroup or AttachmentList an accessible label when context is not clear. Filename links and host preview buttons are the only open targets; remove, retry and cancel stay separate. Uploading exposes a progressbar and a status, errors expose one truncated line with the full reason in its accessible name and title, and completion announces once when the caller changes uploading to ready. Offscreen group cards remain reachable by tabbing.

Installation

Install

Import foundation.css once after shared tokens when using foundational controls.