Displays a file attachment with metadata, status, actions, and optional preview media.
Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
Composition
AttachmentGroup (optional) └── Attachment ├── AttachmentTrigger (optional) ├── AttachmentMedia (optional) ├── AttachmentContent │ ├── AttachmentTitle │ └── AttachmentDescription └── AttachmentActions (optional) └── AttachmentAction
Examples
Default
Loading...
Group
Loading...
Link
Loading...
States
Loading...
Types
Loading...
API Reference
Attachment
| Prop | Type | Default | Description |
|---|---|---|---|
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
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "icon" | "image" | "icon" | Sets how the attachment media is styled. |
AttachmentAction
| Prop | Type | Default | Description |
|---|---|---|---|
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
| Export | API |
|---|---|
attachmentVariants | Style recipe used to reuse the attachment variants. |
attachmentMediaVariants | Style recipe used to reuse the attachment media variants. |
Angular
React
Solid
Svelte
Vue