@get-asset/react

Documents

Styled, drop-in documents table — description, file name, date, source, a status dot, and a type chip per row. A drag-and-drop upload zone (desktop) / header upload button (mobile) sits above the list; use the kebab for Preview / Download / Delete, with Delete opening an inline confirm and Preview opening the full-screen lightbox. Responsive via a container query; covers loading, error, empty, and success.

Preview

Loading preview…

Required scopes

The access token used by AssetProvider must include these scopes for this primitive to fetch data successfully:

  • document:read
  • document:create
  • document:delete

API reference

Root props

PropTypeDefaultDescription
titlestringOverride the card heading. Defaults to "Documents".
uploadHintstringOverride the dropzone hint copy (file types + size limit).
documentTypeDocumentTypeFilter by type (receipt / statement / payroll / bill / mileage / other). Passed to the API.
transactionIdstringFilter to documents linked to a transaction. Passed to the API.
onUpload(type?: DocumentType) => voidProvide to handle uploads yourself — the built-in dropzone upload is skipped.
onDelete(documentId: string) => voidProvide to handle deletion yourself — the built-in delete mutation is skipped.
onDownload(documentId: string) => voidProvide to handle download yourself — the built-in signed-URL download is skipped.
documentsDocumentPublic[]Override fetched data (skips the API call).
state"loading" | "error" | "empty"Force a specific state for testing.
uploadItemsUploadItem[]Seed the upload queue for previews/tests; supports uploading, success, and error chips.
signedUrlOverridestringUse this URL for the preview lightbox, skipping the signed-URL fetch.
classNamestringForwarded to the outer Card wrapper element.

States

Loading

Loading preview…

Error

Loading preview…

EmptyNo documents found.

Loading preview…

UploadingSeeded upload chips covering uploading, success, and error states.

Loading preview…

MobileNarrow container preview of the responsive stacked layout.

Loading preview…