Component
Uploader
File attachment card with media, metadata, and upload lifecycle states. Use for chat composers, message threads, and upload lists.
Installation
Install from the live registry into any shadcn-initialized app (another project). Prefer installing ag-globals first so AG tokens and fonts are present.
npx shadcn@latest add https://design.ag.org/r/uploaderUsage
Use default when nothing is attached (no file name). Show the file name in attach and complete. Compose media, title, and description without inline remove actions for embedded contexts.
Composition
Playground
Preview
Configure
Not used when size is card
Shown only in attach and complete. Default (empty) has no file name.
Code
import {Uploader,
UploaderContent,
UploaderDescription,
UploaderMedia,
UploaderTitle,
} from "@/components/ui/uploader"
import { UploadSimple } from "@phosphor-icons/react"
<Uploader className="w-full max-w-sm">
<UploaderMedia>
<UploadSimple weight="bold" aria-hidden />
</UploaderMedia>
<UploaderContent>
<UploaderTitle>Upload a file</UploaderTitle>
<UploaderDescription>No file attached</UploaderDescription>
</UploaderContent>
</Uploader>Variants & States
Supported variants, sizes, and interaction states for this component.
States
Default is empty (no file name). Attach and complete show the file name.
- Default (empty, no file)
- Attach (file name + uploading)
- Complete (file name)
Sizes
- Default
- Small (`sm`)
- Extra small (`xs`)
- Card (full-width drop zone, dashed border when empty)
Orientation
- Horizontal
- Vertical
Props
Do
- Use default when nothing is attached — no file name yet
- Show the file name only in attach and complete
- Embed without inline remove actions; clear files from the parent context
Don't
- Don't show a file name in the empty default state
- Don't add dismiss or remove buttons when the uploader is embedded inline