File upload

A drag-and-drop file upload zone.

Multiple

Image preview

Files the record already holds

  • avatar.webp41.2 KB
  • contract-2026.pdf180.0 KB

With progress

report-q2.pdf70%

API reference

Inputs

PropTypeDefaultDescription
multiplebooleanfalseWhether multiple files can be selected and accumulated.
acceptstring''Comma-separated list of accepted file types (the `accept` attribute).
namestring''Native `name` attribute for the file input.
hintstring''Optional helper text shown under the dropzone label.
disabledbooleanfalseWhether the upload zone is disabled.
valueBuiFileUploadSourcenullThe file(s) the record already holds — a URL, a list of URLs, or descriptors. Each becomes an ordinary row: same thumbnail, same name and size, same remove button. Removing one reports rather than withdrawing anything; the file belongs to your record, so dropping it from `value` is yours to do.
dropzoneLabelstringCustom dropzone prompt text.
removeLabelstringCustom accessible label for each remove button.

Outputs

EventPayloadDescription
filesChangereadonly File[]Emitted with the picked files whenever the selection changes. Stored files are not in it.
fileRemoveBuiFileUploadRemovalEmitted when the remove button on a row that came from `value` is pressed.

Types

BuiFileUploadRemoval — What reports when a stored file's row is removed.

FieldTypeDescription
urlstringThe `url` of the row that was removed.
namestringThe name that row was showing.

BuiFileUploadSource — Everything `value` accepts: one URL, one descriptor, or a list of either.

string | BuiFileUploadValue | readonly (string | BuiFileUploadValue)[]

BuiFileUploadValue — A file the consumer's record already holds — an avatar, a logo, an attachment saved last week. It is the field's *current value*, which is the one thing a file input cannot express: the native control carries what is being picked now, never what was picked before.

FieldTypeDescription
urlstringWhere the stored file lives. Doubles as the thumbnail source for an image.
name?stringRow label. Defaults to the last path segment of `url`.
size?numberSize in bytes, when the record knows it. A row without one shows no size.
image?false | trueRender `url` as a thumbnail. Inferred from the extension when left unset.

Every ng-blatui component also accepts a class input to merge extra Tailwind classes onto the host.