YuhuanStudioYunUIDocs
Chat

Chat Attachment

A compact attachment surface for the composer and sent messages — name, meta, preview, upload progress and status.

A compact attachment surface shared by the composer (files queued to send) and sent messages (files already attached). It owns the visual hierarchy, upload-progress treatment and status affordances; the host supplies the localized name/meta, an optional preview thumbnail or icon, and any actions.

Import

tsx
1import { ChatAttachment } from "@yuhuanowo/yunui/chat";

Basic

Basic

quarterly-report.pdf
2.4 MB · PDF

Uploading

Set status="loading" and a progress (0–100) to render a determinate bar and a spinner. Omit progress for an indeterminate spinner only.

Uploading

dataset.csv
Uploading… 68%

Error

status="error" tints the surface and swaps in an alert glyph; the meta line carries the reason.

Error

video.mov
File exceeds 25 MB limit

With actions

Pass actions (e.g. an IconButton to remove) — they sit on the trailing edge of the row.

With actions

design-spec.fig
1.1 MB · Figma

Props

ChatAttachment also forwards any <div> HTML attributes.

PropTypeDefaultDescription
actionsReactNode
iconReactNode
metaReactNode
name*ReactNode
previewReactNode
progressnumber
status"idle" | "loading" | "error"idle

On this page