Default Light
MgLibrary
Overview
Installation
Buttons
Cards
Charts
Codes
Data Grids
Dropdowns
Editors
Headers & Animations
Icons
Indicators
Inputs
Lists
Modals
Menus
Panels
Pills & Chips
Scheduling
Tabs
Time Line
Trees
Customization

Sortable Lists

Drag and drop items to reorder them in a list.

Use this example to explore default behavior, customization points, and accessibility-friendly patterns in a real Blazor page.

Sortable List

MgSortableList

A generic list container that lets users drag items to reorder them and receive selection and reorder callbacks.

API Reference

MgSortableList

Property Type Default Description
Items List<TItem> [] The items rendered in the sortable list.
ItemTemplate RenderFragment<TItem> - Template used to render each item.
EmptyContentMessage string "No items." Message shown when the list is empty.
Classes string "" Additional CSS classes applied to the list container.
ItemSelected EventCallback<TItem> - Triggered when an item is clicked.
ItemsReordered EventCallback<List<TItem>> - Triggered after drag and drop reorders the list.
An unhandled error has occurred. Reload 🗙