Skip to content

File Manager for Angular

AngularData

Browses and organizes files held by a host-supplied async provider: a folder tree and the folder content side by side in a Splitter, a breadcrumb path, a toolbar, virtualized list and grid views, sorting, multiple selection, rename, new folder, delete with confirmation, move by drag and drop or cut and paste, uploads with progress and cancel, and previews (images in an Image Viewer lightbox, text and code in a Code Viewer dialog, or a custom preview). Every provider call is abortable and every failure is shown and reported.

  • Your storageOne async provider (list, create, rename, move, delete, upload) with an AbortSignal on every call.
  • Built from AbsoluteUITree View folders, a Splitter, a Breadcrumb path, menus, dialogs, and progress bars.
  • 10,000 files per folderList and grid views on the shared windowing engine keep about 30 entries in the DOM.
  • Keyboard firstListbox selection, F2, Delete, Ctrl+X and Ctrl+V moves, Backspace up, and a context menu.
  • PreviewsImages open in the Image Viewer, text and code in the Code Viewer, anything else in your preview.

Behavior, design tokens, and limitations are described on the File Manager page; this page covers the Angular API.

import { Component } from '@angular/core';
import type { FileEntry, FileManagerOpenDetail, FileManagerProvider } from '@absoluteui/components/file-manager';
import { AuiFileManager } from '@absoluteui/angular/file-manager';
// An in-memory provider; a real one calls your API and passes request.signal to fetch.
const entries: FileEntry[] = [
{ id: 'contracts', name: 'Contracts', kind: 'folder', parentId: null },
{ id: 'offer', name: 'Offer letter.txt', kind: 'file', size: 2048, mimeType: 'text/plain', parentId: 'contracts' },
{ id: 'handbook', name: 'Handbook.txt', kind: 'file', size: 4096, mimeType: 'text/plain', parentId: null },
];
let next = 1;
const documentsProvider: FileManagerProvider = {
list: async (folderId) => entries.filter((e) => e.parentId === folderId),
createFolder: async (parentId, name) => {
const entry: FileEntry = { id: `folder-${String(next++)}`, name, kind: 'folder', parentId };
entries.push(entry);
return entry;
},
rename: async (entry, name) => ({ ...entry, name }),
move: async (moved, targetFolderId) => moved.map((e) => ({ ...e, parentId: targetFolderId })),
delete: async () => {},
upload: async (folderId, file, request) => {
request.onProgress(file.size, file.size);
return { id: `file-${String(next++)}`, name: file.name, kind: 'file', size: file.size, mimeType: file.type, parentId: folderId };
},
};
@Component({
selector: 'app-documents',
imports: [AuiFileManager],
template: `<aui-file-manager label="Employee documents" [provider]="provider" view="grid" (opened)="onOpen($event)"></aui-file-manager>`,
})
export class DocumentsComponent {
readonly provider = documentsProvider;
lastOpened = '';
onOpen(detail: FileManagerOpenDetail): void {
this.lastOpened = detail.entry.name;
}
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiFileManager } from '@absoluteui/angular/file-manager';

Defaults for every instance: provideAbsoluteUIConfig({ components: { fileManager: { ... } } }) (see Configuration).

Class AuiFileManager; template reference #ref="auiFileManager".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Input Type Default Description
label string Required. Accessible name of the File Manager region, such as ‘Company documents’.
provider FileManagerProvider Required. Async storage: list, createFolder, rename, move, delete, upload, and optional getUrl and read; every call receives an AbortSignal.
root FileManagerRoot { id: null, label } The top folder { id, label }; changing it lists the new root.
readOnly boolean false No create, rename, move, delete, or upload.
accept readonly string[] Accepted uploads: MIME types (image/*) and extensions (.csv).
maxFileSize number Largest accepted upload in bytes.
preview false | "auto" | FileManagerPreview 'auto' Preview of opened files: auto (images in an Image Viewer lightbox, text and code in a Code Viewer dialog), false, or a function returning a Node.
height string | null '32rem' Block size as a CSS length, or null to fill the host.
icons Partial<FileManagerIcons> Entry and toolbar icons.
view FileManagerView 'list' List rows with columns, or tiles.
sortBy FileManagerSortBy 'name' Sort key.
sortDirection FileManagerSortDirection 'asc' Sort direction.
foldersFirst boolean true Folders before files, whatever the sort.
showFolderPane boolean true Show the folder tree next to the content.
locale string 'en-US' Locale of sizes, dates, sorting, and messages.
timezone string 'UTC' IANA timezone of modified dates.
density Density 'comfortable' Row and tile size.
Output Payload Description
(navigate) FileManagerNavigateDetail Another folder is shown: { folderId, path }. Re-emits aui-navigate.
(changed) FileManagerChangeDetail The user changed the selection: { selected }. Re-emits aui-change.
(opened) FileManagerOpenDetail A file was opened (Enter or double click): { entry }; preventDefault() suppresses the built-in preview. Re-emits aui-open.
(folderCreated) FileManagerCreateFolderDetail A folder was created: { entry }. Re-emits aui-create-folder.
(renamed) FileManagerRenameDetail An entry was renamed: { entry, previousName }. Re-emits aui-rename.
(moved) FileManagerMoveDetail Entries were moved: { entries, targetFolderId, source: ‘drag’ | ‘paste’ }. Re-emits aui-move.
(deleted) FileManagerDeleteDetail Entries were deleted: { entries }. Re-emits aui-delete.
(uploaded) FileManagerUploadDetail One file finished uploading: { entry, file }. Re-emits aui-upload.
(failed) FileManagerErrorDetail A provider call failed: { operation, error, entries }. Re-emits aui-error.

Call them through a viewChild query or a template reference.

Method Description
refresh(): Promise<void> | undefined List the current folder again.
select(ids: readonly string[]): void Select entries of the current folder (no event).
upload(files: readonly File[]): void Upload files to the current folder (checked against accept and maxFileSize).

Pattern: A labelled region with a WAI-ARIA APG toolbar, a Breadcrumb navigation, a Tree View of folders, and the folder content as an APG listbox with multiple selection (focus stays on the listbox; aria-activedescendant names the active entry). Dialogs follow the APG dialog and alertdialog patterns.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see File Manager: Accessibility and performance.