SortableStack
Description
SortableStack is a stack-based container whose child items can be reordered with drag and drop. It wraps a standard Stack internally, tracks a stable identifier for each item, and reports the updated ordering when the user finishes sorting.
Use it when the visual order matters and you need to persist or react to that order, such as dashboards, pinned lists, or configurable layouts.
Usage
Create a SortableStack through the SortableStack(...), VSortableStack(), or HSortableStack() helpers. Add items with stable identifiers, then listen for sorting changes.
Methods
Add(string identifier, IComponent component)adds a component with a stable identifier.Add(SortableStackItem item)adds a prebuilt sortable item.Children(params SortableStackItem[] children)replaces the current children with a new ordered set.LoadSorting(string[] itemOrder)applies a saved identifier order after items have been added.OnSortingChanged(Action<string[]> onSortingChanged)registers a callback for completed reorder operations.AlignItems(...),AlignItemsCenter(),AlignContent(...),JustifyContent(...), andJustifyItems(...)forward layout settings to the inner stack.Wrap(),NoWrap(),Relative(),RemovePropagation(), andNoDefaultMargin()configure layout behavior.Clear()removes all items.Remove(string identifier)removes a single item by identifier.Render()returns the underlying HTML element.
Properties
Backgroundgets or sets the stack background.Margingets or sets the stack margin.Paddinggets or sets the stack padding.CanWrapcontrols whether items may wrap.StylingContainerexposes the element used for special styling.PropagateToStackItemParentindicates whether styling should propagate to parent stack items.
SortableStackItem
Each draggable entry is represented by SortableStackItem.
Identifieris the unique key used for ordering.Componentis the rendered child component.