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
MgSortableListA 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. |