Skip to content

Repository files navigation

MuddyFileExplorer

A standalone MudBlazor-based file explorer component with a compact list UI. Upload, cut/copy/paste, delete, etc.

MuddyFileExplorer sample screenshot

Projects

  • src/MuddyFileExplorer - reusable Razor class library
  • samples/MuddyFileExplorer.Sample - Blazor Web App sample using a sandboxed local file provider

Features

  • Dense MudBlazor file list using MudDataGrid
  • Columns for icon, file name, size, type, and modified date
  • Breadcrumb folder navigation
  • Search/filter box
  • New-file and new-folder actions
  • Upload button and drag-and-drop upload area
  • Queued uploads with per-file progress
  • Provider-driven download action (files and folders)
  • Context actions for open, rename, cut/copy/paste, delete, and download
  • Status bar for selected item/folder summary

Usage

Register MudBlazor in the host app:

builder.Services.AddMudServices();

Include MudBlazor providers in the host layout:

<MudThemeProvider />
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />

Use the component with an IFileExplorerProvider implementation:

@using MuddyFileExplorer
@using MuddyFileExplorer.Components

<MuddyFileExplorer Provider="@FileProvider"
                 Dense="true"
                 MultiSelection="true"
                 MaxUploadFileSize="104857600" />

Provider Contract

Hosts implement IFileExplorerProvider for file operations:

  • list folder contents
  • create file
  • create folder
  • rename item
  • move item (cut/paste; auto-renames on name conflict)
  • copy item (recursive folder copy; auto-renames on name conflict)
  • delete item
  • download item (file stream or folder zip stream)
  • upload file with progress

move and copy never overwrite: when the destination already has an item with the same name they auto-rename (for example x.txtx (2).txt). copy propagates the cancellation token, validates that the destination folder exists, and rejects copying a folder into itself or one of its descendants.

The component offers AllowCut and AllowCopy parameters (both default true), and items carry a CanCopy flag (alongside CanMove, which gates cut). The UI-facing models use opaque item IDs. Providers should not expose physical paths to the browser.

Breaking change (plan 088): CopyAsync is a required interface member, and ListMoveTargetsAsync was removed. The component parameter AllowMove was replaced by AllowCut/AllowCopy. External consumers must implement CopyAsync, drop ListMoveTargetsAsync, and switch to the new parameters — see plan089-migrate-external-consumer.

Styling Overrides

See styling.md for supported CSS hooks and examples for row density, font size, cell padding, and folder link/icon sizing.

Sample

Run the sample from this folder:

dotnet run --project samples/MuddyFileExplorer.Sample/MuddyFileExplorer.Sample.csproj

The sample stores demo files under samples/MuddyFileExplorer.Sample/App_Data/FileExplorerSandbox. It normalizes file paths, rejects traversal outside the sandbox, and serves downloads through the provider download API.

About

A standalone MudBlazor-based file explorer component with a compact list UI. Upload, copy, move, delete, etc.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages