Skip to content
SevenUI
Sign in
On this page

Attachment

Displays file attachments with media previews and actions, for chat composers, uploads, and message threads.

quarterly-report.pdf1.2 MB · PDF
cover.png96 KB

Installation

Bash

Usage

Built for chat composers, message threads, and upload lists. Wrap multiple attachments in AttachmentGroup for a snap-scrolling row. The state prop drives the upload lifecycle styling: idle renders a dashed border, uploading/processing shimmer the title, and error turns the media and description destructive.

Examples

Image cards

orientation="vertical" turns attachments into image-first cards — suited for photo pickers and gallery uploads.

hero-light.png128 KB
hero-dark.png132 KB
og-image.png96 KB

Actions and upload state

AttachmentActions holds buttons that stay clickable above the full-card AttachmentTrigger (the trigger sits behind them in stacking order). Icon-only actions and triggers need aria-labels.

design-assets.zip24 MB
screen-recording.mp4Uploading…

API reference

Attachment

Extends div.

PropTypeDefault
size"default" | "sm" | "xs""default"
orientation"horizontal" | "vertical""horizontal"
state"idle" | "uploading" | "processing" | "error" | "done""done"

AttachmentMedia

Extends div.

PropTypeDefault
variant"icon" | "image""icon"

image expects an img child and dims it while uploading; icon sizes a single icon (or a spinner during uploads).

AttachmentAction

Extends Button — all Button props apply. Defaults to variant="ghost" and size="icon-xs".

AttachmentTrigger

An invisible full-card button (swap the element via the Base UI render prop, for example render={<a href="…" />}). Give it an aria-label describing the open/preview action.

AttachmentGroup, AttachmentContent, AttachmentTitle, AttachmentDescription, AttachmentActions

Structural wrappers (div/span) accepting standard element props.

Was this page helpful?