Skip to content

Attachment ​

File / image chip

A file in a conversation or a form — its name, type, size, a preview, upload progress. For picking files, FileInput or Uploader.

Basic
PDFscript_ep03.pdf212 KB
ZIPupload.zipuploading…
MOVraw.mov
EXEbad.exeUpload failed
  • With href the name is a link that covers the whole card; the remove button and #actions sit above it, so each stays its own control. Remove says which file; when you take the attachment away on @remove, move focus to its neighbour, as with Chip.
  • state shows uploading (with progress, or a spinner) and error.

Usage ​

ts
import { BlessAttachment } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
name*string—
descriptionstring—size / type line
srcstring—image preview
hrefstring—renders <a> when set
state"idle" | "uploading" | "error""idle"
progressnumber—0–100 while uploading; omit for indeterminate
size"md" | "sm""md"
removableboolean—
removeLabelstring"Remove"

Events

NamePayloadDescription
remove[]

Slots

NameScopeDescription
media—
description—
actions—

Released under the MIT License. Character names and artwork belong to their owners.