Skip to Content
@get-asset/reactComponents

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
titlestring—Override the card heading. Defaults to "Documents".
uploadHintstring—Override the dropzone hint copy (file types + size limit).
documentTypeDocumentType—Filter by type (receipt / statement / payroll / bill / mileage / other). Passed to the API.
transactionIdstring—Filter to documents linked to a transaction. Passed to the API.
onUpload(type?: DocumentType) => void—Provide to handle uploads yourself — the built-in dropzone upload is skipped.
onDelete(documentId: string) => void—Provide to handle deletion yourself — the built-in delete mutation is skipped.
onDownload(documentId: string) => void—Provide to handle download yourself — the built-in signed-URL download is skipped.
onViewDetails(documentId: string) => void—Adds a View details item only for statements with a detail view, calling back with the document id — render AssetDocumentDetails for it. Omitted, the item doesn't appear.
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.
signedUrlOverridestring—Use this URL for the preview lightbox, skipping the signed-URL fetch.
classNamestring—Forwarded 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…

On this page