ng-bootstrap HomeBasicAlertFormsFloating labelsInput groupMulti-rangeRangePhone inputSelectRadioCheckboxDatepickerTimepickerDateTime pickerContainersGridCardTab controlRatingBadgeBreadcrumbButton groupButton typeCalendarMarqueeList groupTreeviewTree selectTableClosePaginationPlaceholderSpinnerColor pickerProgress barFor directiveIconOverlaysModalsOffcanvasTooltipToastPopoverDropdownTypeaheadContext menuShellDropdown menu (WC)AdvancedCopyCode snippetPipesTrust-htmlSplit-stringLinifySlugifyWord-countFont-colorHas-propertyToggle buttonsSticky footerAutofocusTrackByAsync HostBindingInstance ofIs interfaceResizableOrdinal numbersMarkdownParallaxPriority navigationScrollspyFile uploadSignature padLazy-loading componentsUser-agentNavigation lockNavigation lock (master/detail)EnterpriseCarouselSchedulerTimelineDockRibbonTile managerDatatablesFile managerQuery builderOTP inputNavbarSplitterAccordionChartsAnimationsSlide up/downFade in/outColor transitionAdditional samplesCollapseFocusTrapDrag-dropTree-select drag-dropQR-code viewerStepperThemingAnchor scrollingSection 1Section 2Section 3Section 4Section 522.15.0

File manager

Enterprise file-browser composed from mp-splitter, mp-treeview, and mp-datatable Lit web components. Tree on the left, file list on the right, breadcrumb above, toolbar with search, view-mode toggle, and file operations. The live demo below is fully interactive: drag-drop files from your OS, rename inline, multi-select, cut/copy/paste, switch the language, simulate read-only permissions, or toggle on the lazy-load tree mode.

Allow drag-drop upload
Use custom dialog resolver
Prompt on name conflict
"Documents" read-only
Lazy-load tree
Keyboard shortcuts
  • In icon view all four arrows plus Home / End rove between the cards: the grid reflows on resize and so has no stable 2-D geometry, which means / both mean “next card” and / both mean “previous”. In details view row focus is the datatable's own / handling, not the file manager's.
  • Enter — same as double-click: navigate into a folder, or emit mp-node-open for a file
  • Ctrl/+click — toggle one item, and Shift+click — extend from the last-selected item. Both need Selection set to multiple; Shift+click only ever adds to the selection, it never trims it.
  • F2 — rename, but only with exactly one item selected
  • Del — delete the selection after a confirmation dialog; does nothing on an empty selection
  • Ctrl+X / Ctrl+C / Ctrl+V — cut / copy / paste ( also works). Cut and copy need a selection, paste needs a filled clipboard, and each needs its operation to be enabled.
  • Ctrl+Shift+N — new folder in the current location
  • Shift+F10 / ContextMenu — open the context menu on the first selected item. With nothing selected, neither key does anything.
  • Long-press (600 ms) on touch — opens the context menu
  • In the context menu: focus moves into it on open, / / Home / End rove between the items, Esc closes it
  • While the rename editor is open it owns every key — Enter commits, Esc abandons the edit, and none of the shortcuts above fire

Integration guide for B2B portals

The component is intentionally event-driven: it renders the UX and emits intents, leaving every consumer to wire the backend, dialog style, and toast system of their own product. The recipes below cover the seven integration points a typical admin portal needs.

1. Operation handler (rename / delete / new folder / paste)

Every mutating action fires (operation) with a discriminated-union payload. The component is fire-and-forget — your handler runs the backend call, optionally marks the affected rows as pending, and reports failures through reportError() (which re-fires (errorReported) for your toast bus).

2. Upload pipeline with progress

Drag-drop and the touch upload button both fire (uploadRequest) carrying pre-registered UploadEntry IDs. Drive your real upload (XHR / fetch / S3 SDK), then push percentage updates into the component via reportUploadProgress(id, pct, status?). The uploads signal on the component reflects the in-flight set so you can render a progress UI wherever you like (the live demo above renders it directly below the file-manager).

3. Custom dialogs (replacing window.confirm / window.prompt)

Most enterprise apps want their own modal styling instead of the browser dialogs. Wire a DialogResolver to your modal service (typically a thin wrapper around bs-modal). When unset, the component falls back to the native dialogs so basic usage still works.

4. Conflict resolution on paste / upload

When a paste or upload would overwrite a same-name entry in the target folder, the component calls conflictResolver once per conflict. Returning 'skip' filters the source out of the operation; 'rename' includes the consumer's chosen newName in the resulting (operation) / (uploadRequest) payload. Unset = silent replace (preserves the v1 behaviour).

5. Lazy-loaded tree

Real file systems aren't materialisable up front. Bind a loadChildren async callback and seed [nodes] with only the top-level entries. The component marks every unloaded folder with a chevron, shows a spinner during the fetch, and merges the returned children back into its store — no consumer-side coordination beyond returning the right data.

6. Internationalisation

Every visible string + ARIA label routes through FileManagerMessages. Pass a partial overrides object via [messages]; unset keys fall back to DEFAULT_FILE_MANAGER_MESSAGES (English). Locale switching works at runtime — the demo above uses three locales.

7. Per-node permissions

Beyond the global [allowOperations] input, every FileSystemNode can carry its own allowOperations partial. The toolbar / context-menu buttons gate against the worst case across the current selection (a multi-row delete is disabled if any selected row is locked).

8. Error reporting → toast bus

Failures from your backend never need to reach into the component's UI directly. Call fm.reportError(message, nodeId?) from your handler and listen on (errorReported) at the template level — that's where you wire the toast / snackbar.

Checklist for production

  • Backend wiring — handle every kind in onOperation + the upload pipeline.
  • Toasts — listen on (errorReported); route to your snackbar.
  • Dialogs — wire dialogResolver to bs-modal if you don't want native browser dialogs.
  • Conflicts — wire conflictResolver if "silent overwrite" isn't your spec.
  • Permissions — surface per-node allowOperations from your auth layer.
  • i18n — pipe your translation service through [messages].
  • Scale — bind [loadChildren] if folder cardinality is unbounded.
  • Touch — no extra wiring; long-press + upload button activate automatically on coarse pointers.