Search documentation

Search the documentation and open a page.

Displays a file attachment with metadata, status, actions, and optional preview media.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/attachment

Composition

AttachmentGroup (optional) └── Attachment ├── AttachmentTrigger (optional) ├── AttachmentMedia (optional) ├── AttachmentContent │ ├── AttachmentTitle │ └── AttachmentDescription └── AttachmentActions (optional) └── AttachmentAction

Examples

Default

Loading...

Group

Loading...
Loading...

States

Loading...

Types

Loading...

API Reference

Attachment

PropTypeDefaultDescription
state"idle" | "uploading" | "processing" | "error" | "done""done"Sets the attachment's current processing state.
type"file" | "card" | "image"—Sets the layout type. Inferred from orientation when omitted.
variant"default" | "muted""default"Sets the attachment's visual style.
size"default" | "sm" | "xs""default"Sets the attachment size.
orientation"horizontal" | "vertical""horizontal"Sets the preferred orientation. File attachments always render horizontally.

AttachmentMedia

PropTypeDefaultDescription
variant"icon" | "image""icon"Sets how the attachment media is styled.

AttachmentAction

PropTypeDefaultDescription
variant"default" | "destructive" | "ghost" | "link" | "outline" | "secondary""ghost"Sets the button style.
size"default" | "icon" | "icon-lg" | "icon-sm" | "icon-xl" | "icon-xs" | "lg" | "sm" | "xl" | "xs""icon-xs"Sets the action button size.

Utilities and Supporting Types

ExportAPI
attachmentVariantsStyle recipe used to reuse the attachment variants.
attachmentMediaVariantsStyle recipe used to reuse the attachment media variants.