SuperSimpleBlazorDropzone 1.1.0

dotnet add package SuperSimpleBlazorDropzone --version 1.1.0
                    
NuGet\Install-Package SuperSimpleBlazorDropzone -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SuperSimpleBlazorDropzone" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SuperSimpleBlazorDropzone" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="SuperSimpleBlazorDropzone" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SuperSimpleBlazorDropzone --version 1.1.0
                    
#r "nuget: SuperSimpleBlazorDropzone, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SuperSimpleBlazorDropzone@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SuperSimpleBlazorDropzone&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=SuperSimpleBlazorDropzone&version=1.1.0
                    
Install as a Cake Tool

Super Simple Blazor Dropzone

Super Simple Blazor Dropzone is a lightweight and easy-to-use file dropzone component for Blazor applications. It allows you to receive files via drag-and-drop or file picker, with minimal configuration and effort.

Features

  • Simple and intuitive API
  • Lightweight and fast
  • Customizable with CSS classes and content
  • Supports .NET 8 and .NET 9
  • Supports both base64 and binary file transfer
  • JavaScript interop for drag-and-drop and file selection
  • Supports multiple file uploads

Installation

To install the package, run the following command:

dotnet add package SuperSimpleBlazorDropzone

Usage

Use the SimpleDropzone component in your Blazor pages or components:

@using SuperSimpleBlazorDropzone

<SimpleDropzone OnBase64FilesReceived="@OnBase64FilesReceived" />

@code {
    private Base64FileTransfer? _base64File;

    private void OnBase64FilesReceived(IEnumerable<Base64FileTransfer> files)
    {
        _base64File = files.FirstOrDefault();
    }
}

Customizing Content and Output

You can customize the dropzone's appearance, output type, and content. For example, to receive binary data and use custom CSS/content:

<SimpleDropzone
    CssClass="custom"
    DragActiveCssClass="custom-drag-active"
    ContentOutputType="@FileContentOutput.Binary"
    OnBinaryFilesReceived="@OnBinaryFilesReceived">
    <span>As you can see, this is some customized content for binary files. Please drop here to see it working</span>
</SimpleDropzone>

@code {
    private BinaryFileTransfer? _binaryFile;

    private void OnBinaryFilesReceived(IEnumerable<BinaryFileTransfer> files)
    {
        _binaryFile = files.FirstOrDefault();
    }
}

Multiple File Uploads

Enable multiple file uploads by setting AllowMultipleFiles="true":

<SimpleDropzone AllowMultipleFiles="true" OnBase64FilesReceived="@OnMultipleFilesReceived" />

@code {
    private List<Base64FileTransfer> _multipleFiles = new();

    private void OnMultipleFilesReceived(IEnumerable<Base64FileTransfer> files)
    {
        _multipleFiles = files.ToList();
    }
}

Example Output Rendering

@if (_binaryFile != null)
{
    <div>
        <h4>File Name: @_binaryFile.Name</h4>
        <h4>File Size: @_binaryFile.Size</h4>
        <h4>File Type: @_binaryFile.Type</h4>
        <h4>File Extension: @_binaryFile.Extension</h4>
        <h4>File Content:</h4>
        <pre class="w-100 text-truncate" style="max-width: 100%; max-height: 10rem; overflow: auto;">
            @(_binaryFile.Content != null 
                ? BitConverter.ToString(_binaryFile.Content).Replace("-", " ") 
                : string.Empty)
        </pre>
        @if (!string.IsNullOrWhiteSpace(_binaryFile.ImgSrc))
        {
            <img src="@_binaryFile.ImgSrc" alt="Uploaded Image" />
        }
    </div>
}

Parameters

  • CssClass (string): The CSS class applied to the dropzone container. Default is "file-dropper".
  • DragActiveCssClass (string): The CSS class applied when a file is being dragged over the dropzone. Default is "drag-active".
  • ContentOutputType (FileContentOutput): Determines the format of the file content received (Base64 or Binary). Default is Base64.
  • DropperId (string): The unique ID for the dropzone element. Defaults to a new GUID.
  • ChildContent (RenderFragment?): Custom content to render inside the dropzone. If not provided, a default message is shown.
  • OnBase64FilesReceived (EventCallback<IEnumerable<Base64FileTransfer>>): Callback invoked when one or more files are received as base64 data.
  • OnBinaryFilesReceived (EventCallback<IEnumerable<BinaryFileTransfer>>): Callback invoked when one or more files are received as binary data.
  • AllowMultipleFiles (bool): If true, allows multiple file selection and drag-and-drop. Default is false.

Styling

You can customize the dropzone with your own CSS classes. Example:

.custom {
    border: 3px dashed #ff6f61;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(135deg, #f9d423 0%, #ff4e50 100%);
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
}
.custom-drag-active {
    border-color: #43cea2;
    background: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
    color: #fff;
    animation: dragPulse 1s infinite alternate;
}
@keyframes dragPulse {
    from { box-shadow: 0 0 24px 4px #43cea2; }
    to   { box-shadow: 0 0 48px 8px #43cea2; }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 23 8/25/2025
1.0.2 17 8/24/2025
1.0.1 17 8/23/2025
1.0.0 26 8/23/2025