useAttachmentManager
HookManages file attachments with concurrent upload, progress tracking, status states (pending, uploading, done, error), and max-file enforcement.
core/use-attachment-managerInstallation
1 · Add registry to components.json
2 · Install component
Examples
File attachments
Add files with a file input. Each is uploaded concurrently.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
uploader | AttachmentUploader | — | Async function that uploads a File and returns a URL string. |
maxFiles | number | — | Maximum number of attachments allowed. |
(returns) addFiles | (files: File[]) => void | — | Add and immediately begin uploading files. |
(returns) removeAttachment | (id: string) => void | — | Remove an attachment by its generated ID. |
(returns) attachments | ManagedAttachment[] | — | Current list of managed attachment objects. |
(returns) isUploading | boolean | — | True when any attachment is in uploading state. |