Skip to content
Look

Shared with the landing page. Theme is the select beside this menu.

Attachment

Open .md
Live preview

Loading example…

File chip or preview tile for prompt attachments, with an optional remove button.

import { Attachment } from "@jcsoftdev/ui/ai";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/ai/attachment.

<Attachment
name="agenda-sabado.pdf"
size="240 KB"
variant="chip"
status="done"
/>
Prop Type Default Description
name * string
size string Pre-formatted size, e.g. 240 KB.
previewSrc string Image URL (or object URL). Without it a document icon is shown.
status "done" | "uploading" | "error" "done"
progress number 0-100, only for uploading.
variant "chip" | "preview" "chip" chip is one compact line; preview is a tile with a larger thumbnail.
onRemove (() => void) Shows the remove button.
classNames Partial<Record<AttachmentPart, string>> Per-part classes merged with cn; consumer classes win. className still targets the root and is merged last.
intent string
intentKey string

* marks a required prop.

It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).

packages/ui/src/ai/attachment/attachment.tsx