Attachment

A file in a message: its icon or picture, name and size, with an upload state.

@cupertinoui/attachmentRegistry JSON

Installation

pnpm dlx shadcn@latest add @cupertinoui/attachment

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

import { Attachment, AttachmentContent, AttachmentMedia, AttachmentTitle } from "@/components/ui/attachment"

<Attachment>
  <AttachmentMedia><FileTextIcon /></AttachmentMedia>
  <AttachmentContent>
    <AttachmentTitle>Roadmap.key</AttachmentTitle>
  </AttachmentContent>
</Attachment>

API Reference

Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.

Attachment

PropTypeDescription
state"idle" | "uploading" | "processing" | "error" | "done"
Default: "done"
Shows progress or an error.
size / orientationThe layout.
classNamestringExtra classes, merged with the component's own.