Components
Attachment
A file or attachment card with upload state and actions.
Attachment is a composable card for displaying files and uploads. It supports upload states, sizes, and orientations, with optional media and action slots.
Installation
pnpm dlx shadcn@latest add https://faber-ui.vercel.app/r/attachment.jsonUsage
import {
Attachment,
AttachmentAction,
AttachmentActions,
AttachmentContent,
AttachmentDescription,
AttachmentMedia,
AttachmentTitle,
} from "@/components/ui/attachment";
import { RiDownloadLine, RiFileTextLine } from "@remixicon/react";
export default function Example() {
return (
<Attachment>
<AttachmentMedia variant="icon">
<RiFileTextLine />
</AttachmentMedia>
<AttachmentContent>
<AttachmentTitle>report.pdf</AttachmentTitle>
<AttachmentDescription>1.2 MB</AttachmentDescription>
</AttachmentContent>
<AttachmentActions>
<AttachmentAction render={<button />}>
<RiDownloadLine />
</AttachmentAction>
</AttachmentActions>
</Attachment>
);
}Examples
Default
Upload states
Sizes
Group
API
Each part forwards every prop of what it is built on, including className and render where Base UI supports it. The props column lists only what Faber UI adds on top.
| Part | Built on | Props |
|---|---|---|
Attachmentdata-slot="attachment" | <div>HTML |
|
AttachmentMediadata-slot="attachment-media" | <div>HTML |
|
AttachmentContentdata-slot="attachment-content" | <div>HTML | — |
AttachmentTitledata-slot="attachment-title" | <span>HTML | — |
AttachmentDescriptiondata-slot="attachment-description" | <span>HTML | — |
AttachmentActionsdata-slot="attachment-actions" | <div>HTML | — |
AttachmentActiondata-slot="attachment-action" | ButtonFaber UI | — |
AttachmentTriggerdata-slot="attachment-trigger" | <button>HTML | — |
AttachmentGroupdata-slot="attachment-group" | <div>HTML | — |
Last updated on