Soenneker.Blazor.SheetMapper
4.0.553
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Blazor.SheetMapper --version 4.0.553
NuGet\Install-Package Soenneker.Blazor.SheetMapper -Version 4.0.553
<PackageReference Include="Soenneker.Blazor.SheetMapper" Version="4.0.553" />
<PackageVersion Include="Soenneker.Blazor.SheetMapper" Version="4.0.553" />
<PackageReference Include="Soenneker.Blazor.SheetMapper" />
paket add Soenneker.Blazor.SheetMapper --version 4.0.553
#r "nuget: Soenneker.Blazor.SheetMapper, 4.0.553"
#:package Soenneker.Blazor.SheetMapper@4.0.553
#addin nuget:?package=Soenneker.Blazor.SheetMapper&version=4.0.553
#tool nuget:?package=Soenneker.Blazor.SheetMapper&version=4.0.553
Soenneker.Blazor.SheetMapper
A Blazor upload-and-selection component for matching CSV or tab-delimited column headers to writable properties on a C# type.
SheetMapper produces a property-to-header dictionary. It does not parse data rows, convert cell values, validate a complete mapping, or create model instances.
Installation
dotnet add package Soenneker.Blazor.SheetMapper
Register SheetMapper and its FilePond and Tom Select dependencies in Program.cs:
using Soenneker.Blazor.SheetMapper.Registrars;
builder.Services.AddSheetMapperAsScoped();
Add the component namespace to _Imports.razor:
@using Soenneker.Blazor.SheetMapper
Usage
@page "/employees/import"
<SheetMapper @ref="_mapper"
TargetType="typeof(Employee)"
AutomaticallyMap="true" />
<button type="button" @onclick="UseMapping">Continue</button>
@code {
private SheetMapper? _mapper;
private void UseMapping()
{
Dictionary<string, string> mapping = _mapper!.GetCurrentMap();
// Example:
// mapping["FirstName"] == "First Name"
// mapping["Department"] == "" when no column was selected
}
}
TargetType is required. The component creates one selector for each public, writable, non-indexer property. Uploading a new file replaces the current headers and mapping.
Mapping behavior
When AutomaticallyMap is enabled—or when AutoMap() is called—the mapper compares each property name with the uploaded headers:
- comparison is case-insensitive;
- spaces are removed from headers before the second comparison;
- punctuation, underscores, aliases, and data annotations are not normalized;
- multiple properties may select the same header.
Duplicate selections are marked in the UI but are not rejected. Validate the dictionary before using it if every property must map to a unique column.
GetCurrentMap() returns property names as keys and selected source headers as values. Unmapped properties have an empty-string value.
Parameters
| Parameter | Default | Purpose |
|---|---|---|
TargetType |
— | Type whose public writable properties are displayed. |
AutomaticallyMap |
false |
Runs the built-in name-matching heuristic after an upload. |
ShowStatusIcons |
true |
Shows mapped, unmapped, and duplicate indicators. |
NotMappedIcon |
⚠️ |
Markup used for an unmapped property. |
DuplicatedIcon |
🔁 |
Markup used when a header is selected more than once. |
MappedIcon |
✅ |
Markup used for a unique selection. |
The rendered markup uses Bootstrap-style classes such as input-group, input-group-text, and form-control. Include compatible host styles or override those classes in your application. Package CSS is loaded automatically when the component becomes interactive.
Upload considerations
- The upload is read in the browser interop path and is limited by FilePond's configured maximum stream size; the default configuration used here limits the stream to 2 MB.
- File content is used only to discover headers. Your application remains responsible for validating the file, parsing rows, converting values, and enforcing import limits before persistence.
- Spreadsheet formats such as
.xlsxare not supported. Export them as CSV or tab-delimited text first.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Sep (>= 0.17.0)
- Soenneker.Blazor.FilePond (>= 4.0.3857)
- Soenneker.Blazor.TomSelect (>= 4.0.4637)
- Soenneker.Blazor.Utils.Ids (>= 4.0.25)
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 |
|---|---|---|
| 4.0.562 | 0 | 9/1/2026 |
| 4.0.561 | 0 | 9/1/2026 |
| 4.0.560 | 0 | 9/1/2026 |
| 4.0.559 | 0 | 8/31/2026 |
| 4.0.558 | 0 | 8/31/2026 |
| 4.0.557 | 0 | 8/31/2026 |
| 4.0.556 | 0 | 8/31/2026 |
| 4.0.555 | 29 | 8/31/2026 |
| 4.0.554 | 36 | 8/31/2026 |
| 4.0.553 | 38 | 8/30/2026 |
| 4.0.552 | 41 | 8/30/2026 |
| 4.0.551 | 35 | 8/29/2026 |
| 4.0.550 | 39 | 8/29/2026 |
| 4.0.549 | 43 | 8/27/2026 |
| 4.0.548 | 43 | 8/27/2026 |
| 4.0.547 | 57 | 8/26/2026 |
| 4.0.546 | 60 | 8/26/2026 |
| 4.0.545 | 66 | 8/26/2026 |
| 4.0.544 | 62 | 8/26/2026 |
| 4.0.543 | 95 | 8/22/2026 |
Update dependency Soenneker.Blazor.Utils.Ids to 4.0.25 (#1327)