Kebechet.Blazor.SortableJS 1.15.7

Prefix Reserved
dotnet add package Kebechet.Blazor.SortableJS --version 1.15.7
                    
NuGet\Install-Package Kebechet.Blazor.SortableJS -Version 1.15.7
                    
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="Kebechet.Blazor.SortableJS" Version="1.15.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Kebechet.Blazor.SortableJS" Version="1.15.7" />
                    
Directory.Packages.props
<PackageReference Include="Kebechet.Blazor.SortableJS" />
                    
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 Kebechet.Blazor.SortableJS --version 1.15.7
                    
#r "nuget: Kebechet.Blazor.SortableJS, 1.15.7"
                    
#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 Kebechet.Blazor.SortableJS@1.15.7
                    
#: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=Kebechet.Blazor.SortableJS&version=1.15.7
                    
Install as a Cake Addin
#tool nuget:?package=Kebechet.Blazor.SortableJS&version=1.15.7
                    
Install as a Cake Tool

"Buy Me A Coffee"

Blazor.SortableJS

NuGet Version NuGet Downloads Build codecov Storybook Last updated Twitter

A typed Blazor wrapper for SortableJS 1.15.7. The pinned bundle is a static web asset and is registered automatically: no npm install, CDN, or script tag is required.

Live storybook - interactive stories for every feature.

Installation

dotnet add package Kebechet.Blazor.SortableJS

Usage

The bound IList<T> is reordered in place. Item objects are never serialized through JavaScript, so their reference identity is preserved.

@using Kebechet.Blazor.SortableJS

<Sortable Items="_exercises" Context="exercise"
          Options="_options"
          ItemClass="exercise-card">
    <ItemTemplate>@exercise.Name</ItemTemplate>
</Sortable>

@code {
    private readonly List<Exercise> _exercises = new()
    {
        new("Squat"),
        new("Bench press"),
        new("Deadlift")
    };

    private readonly SortableOptions _options = new()
    {
        AnimationDuration = 150,
        GhostClass = "drag-ghost"
    };

    private sealed record Exercise(string Name);
}

Connected and nested lists only need the same group name. Each component registers itself automatically, regardless of nesting depth.

<Sortable Items="_backlog" Options="_connected" Context="item">
    <ItemTemplate>@item</ItemTemplate>
</Sortable>
<Sortable Items="_done" Options="_connected" Context="item">
    <ItemTemplate>@item</ItemTemplate>
</Sortable>

@code {
    private readonly List<string> _backlog = new() { "Design", "Implement" };
    private readonly List<string> _done = new() { "Verify" };
    private readonly SortableOptions _connected = new()
    {
        Group = new SortableGroupOptions
        {
            Name = "work",
            PullMode = PullMode.Enabled,
            PutMode = PutMode.Enabled
        }
    };
}

Use CloneFunction to create a distinct object for clone mode, or ConvertFunction on a destination whose item type differs from the source. ShouldUseItemKeys is enabled by default; set ItemKeySelector when the item itself is not the desired stable key. SortableDefaults.Options supplies app-wide defaults.

All fifteen callbacks use SortableEventArgs<TItem>. OnAdd runs before collection mutation, while the moved reference is still in the source; OnRemove follows. OldIndexes and NewIndexes contain every affected index for MultiDrag, not only the primary item.

Coverage vs. SortableJS 1.15.7

Axis SortableJS 1.15.7 This package
Options 47 47
Events 15 15

The counts come from the actual vendored 1.15.7 source: 33 core options, 6 AutoScroll options, 2 OnSpill options, 2 Swap options, and 4 MultiDrag options. The event count is the 12 core callbacks plus MultiDrag select/deselect and OnSpill spill. Internal plugin hooks are excluded. Function-valued JavaScript options are represented by typed Blazor-friendly forms: local-storage SortableStoreOptions, SetDataText/SetDataTextSelector, SortableDirection, CSS filter and scroll-container selectors, and ShouldContinueNativeScrolling.

Features

  • In-place same-list, cross-list, and multi-item moves with reference identity preserved
  • Automatic depth-independent registration for recursive lists
  • Pull/put group policies, clone mode, and cross-type conversion
  • MultiDrag, Swap, AutoScroll, RevertOnSpill, and RemoveOnSpill
  • Stable keyed rendering and app-wide defaults
  • DOM rollback before Blazor mutation, full event coverage, and deterministic disposal
  • net6.0 through net10.0

License

MIT

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 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. 
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.15.7 45 7/27/2026

Initial release wrapping SortableJS 1.15.7.