UploadManager
Validate, queue, upload, cancel, and retry files.
Live TypeScript example
Try the component here, then use the source below in your application.
- JavaScript
- 4.3 KiB
- Component CSS
- 1.2 KiB
- Shared theme CSS
- 3.8 KiBonce per application
How sizes are measured
The JavaScript figure includes this component’s required helpers. CSS includes its styling dependencies. Each entry is bundled separately for ES2022, minified, then compressed with gzip level 9. Your bundler may share helpers across components. Images, fonts, examples and application code are excluded.
Before compression: JavaScript 11.2 KiB; component CSS 4.0 KiB. These figures describe browser assets, not the complete package download.
View all component measurements →Choose a small file and upload it. This demonstration discards the file after transfer.
import '@blukavantui/web/theme.css'
import {createUploadManager} from '@blukavantui/web/upload-manager';
import '@blukavantui/web/upload-manager.css';
export function mount(host: HTMLElement) {
const output = document.createElement("p");
host.append(output);
const csrf = document.querySelector<HTMLMetaElement>(
'meta[name="csrf-token"]',
)?.content;
const uploads = createUploadManager(
host,
{
UploadUrl: "/demo/upload", // Disposable endpoint included by the starter's Vite dev server.
Headers: csrf ? { "x-csrf-token": csrf } : {},
Accept: ".txt,.png,.jpg,.jpeg,.pdf",
MaxFiles: 5,
MaxFileSizeMB: 1,
},
{
Uploaded: (_key, name) => {
output.textContent = `${name} transferred and discarded.`;
},
Error: (message) => {
output.textContent = message;
},
},
);
// Use your own authorized HTTPS multipart endpoint when integrating into an application.
return {
destroy() {
uploads.destroy();
output.remove();
},
};
}
const instance = mount(document.getElementById('example')!)
// When this page or framework component is removed:
// instance.destroy()
Install the library and add the host element
npm install https://blukavantui.blutekmedia.com/downloads/blukavantui-web-0.6.2.tgz<div id="example"></div>This example uses the downloadable @blukavantui/web package. Your application handles persistence and authentication through its typed callbacks. The starter ZIP includes this same example.
createUploadManager
Supply your own upload endpoint and any request headers. The component handles the transfer UI; your application owns authorization, validation and storage.
import { createUploadManager } from '@blukavantui/web/upload-manager';
import '@blukavantui/web/upload-manager.css';Load @blukavantui/web/theme.css once in your app shell.createUploadManager(host: HTMLElement, options: T.UploadManagerOptions, events?: T.UploadManagerEvents)Reference for @blukavantui/web 0.6.2. Required and optional follow the shipped TypeScript declarations; optional does not imply a particular default. Pass typed arrays and objects directly where shown.
Options
9| Name | Type / requirement | Usage |
|---|---|---|
UploadUrl | stringRequired | |
Headers | Record<string, string>Optional | |
FieldName | stringOptional | |
WithCredentials | booleanOptional | |
Accept | stringOptional | |
MaxFiles | numberOptional | |
MaxFileSizeMB | numberOptional | |
ConcurrentUploads | numberOptional | |
IsDisabled | booleanOptional | Disables interaction with this component. |
Callbacks
3| Name | Type / requirement | Usage |
|---|---|---|
QueueChanged | (queue: T.UploadItem[]) => void | Promise<void>Optional | |
Uploaded | (key: string, name: string, responseText: string) => void | Promise<void>Optional | |
Error | (message: string) => void | Promise<void>Optional |
Instance methods & properties
3| Name | Signature / type | Usage |
|---|---|---|
element | HTMLElement | Root owned by this instance. Dispose before removing its host. |
update | (patch: Partial<T.UploadManagerOptions>) => void | Apply a partial options update to this instance. |
destroy | () => void | Dispose the instance and its listeners when the view is removed. |
Related data types
Expand a type for its fields and allowed values.
Callback
type Callback<T extends unknown[] = []> = (...args: T) => void | Promise<void>;ErrorEvents
interface ErrorEvents {
Error?: Callback<[message: string]>;
}UploadItem
interface UploadItem {
Key: string;
Name: string;
Size: number;
Status: "queued" | "uploading" | "uploaded" | "error" | "canceled";
Progress: number;
ErrorMessage: string;
}Use these inputs, events, actions and structures in Service Studio. Names and data bindings are specific to the native Blocks.
Included in the planned free BluKavantUI Community edition. The official OutSystems Forge release is coming soon. View Community scope →
Open OutSystems showcase ↗- Web runtime
- Supported
- TypeScript
- Supported
- OutSystems
- Supported
Statuses describe the component’s rendered code and interactions. Supply accessible content and follow the component guidance when integrating it.
Accessibility guidance →Purpose and use
Use UploadManager when people need visible progress and control over multiple uploads. Explain file types and limits before browsing.
Keyboard design guidance
Browse files works with Enter or Space. Every queued file has individually labelled actions. Progress and errors are announced. Drag and drop has a Browse alternative.
See the support status above for review coverage and any limitations.
In your application
Provide useful labels, preserve visible focus, and test the component with your actual content. Use text alongside status colors and check contrast in each state.
Events0No events yet.
Interact with an example to see its events.