Forms

Upload

@xui/upload

A file upload — a button or a drag-and-drop zone with a file list showing size, progress and a remove control. files is two-way bindable; selected emits the raw Files for the host to upload.

Install

pnpm add @xui/upload

Add the barrel to a standalone component's imports:

import { XuiUploadImports } from '@xui/upload';

@Component({
  imports: [XuiUploadImports],
  // …
})

Examples

Button

Loading preview…

Dragger

Loading preview…

API

XuiUpload

componentxui-upload

A file upload with a button or drag-and-drop zone and a file list showing per-file progress, status and a remove control. files is a two-way bindable list; selected emits the raw Files so the host can perform the upload and update each file's status/percent.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''typeXuiUploadTypeHow files are chosen: a button that opens the picker, or a drop zone that also accepts a drag.this.config.typemultiplebooleanAccept more than one file. With this off, a new choice replaces the current file rather than adding to it.falseacceptstringPassed to the native input's accept — a comma-separated list of extensions or MIME types, and shown as a hint under a drop zone. A filter for the file chooser, not validation.''disabledbooleanBlock choosing and dropping, and dim the control.falsefilestwo-wayXuiUploadFile[]The chosen files and their upload state. Two-way bindable — write back to it to report progress or mark a file as failed.[]

Outputs

NameTypeselectedFile[]The raw files just chosen (for the host to upload).

Source

libs/ui/upload/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.