For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/v0.4.0/en/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/v0.4.0/en/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/v0.4.0/en/components/message-attachment.md.

Message Attachment

Message Attachment presents a file, image, source range, or URL associated with one message. Upload and persistence remain application responsibilities.

Live preview
release-notes.mdMarkdown · 12 KB
workspace.pngUploading · 72%

Usage

<article class="message-attachment" data-state="complete">
  <figure aria-hidden="true">...</figure>
  <div data-attachment-identity><strong>release-notes.md</strong><span data-attachment-meta>Markdown · 12 KB</span></div>
  <button type="button" aria-label="Remove release-notes.md">...</button>
</article>

Parameters

APIValuesPurpose
data-stateready, uploading, complete, missing, errorAttachment lifecycle
data-attachment-identityRequiredName and type or source range
data-attachment-metaOptionalSize, upload progress, or path

States and variants

Preserve the item after upload failure so users can retry or remove it. A missing source range names the unavailable file and recovery.

Accessibility

Removal and retry labels include the attachment name. Decorative file-kind icons stay hidden from assistive technology.