useAttachmentManager

Hook

Manages file attachments with concurrent upload, progress tracking, status states (pending, uploading, done, error), and max-file enforcement.

core/use-attachment-manager

Installation

1 · Add registry to components.json

2 · Install component

Examples

File attachments

Add files with a file input. Each is uploaded concurrently.

API Reference

PropTypeDescription
uploader
AttachmentUploaderAsync function that uploads a File and returns a URL string.
maxFiles
numberMaximum number of attachments allowed.
(returns) addFiles
(files: File[]) => voidAdd and immediately begin uploading files.
(returns) removeAttachment
(id: string) => voidRemove an attachment by its generated ID.
(returns) attachments
ManagedAttachment[]Current list of managed attachment objects.
(returns) isUploading
booleanTrue when any attachment is in uploading state.