pub fn SortableList(_: SortableListProps) -> ElementExpand description
A list whose items can be dragged to reorder.
The component is data-agnostic: give it a len and a render callback
keyed by index. It renders one wrapper div[draggable] per item and emits
a SortEvent when the user drops. The item currently hovered as a drop
target gets data-drop-target="true" on its wrapper for styling, and the
dragged item gets data-dragging="true".
§Props
For details, see the props struct definition.
len:usizeNumber of items.
render:Callback<usize,Element>Renders the item at the given index.
on_sort:EventHandler<SortEvent>Fired when the user drops an item at a new position.
axis:AxisList direction: which axis rows are laid out (and shifted) along.
live_preview:boolOpen a live gap where the drop would land, by translating the rows in between. Set
falsefor the plain highlight-only behavior.touch_handle:boolConfine touch/pen drags to a leading grip element instead of the whole row. The grip carries
touch-action: noneso the rest of the row keeps scrolling by finger — use this inside scrollable lists. Style it via[data-sort-handle].attributes:Vec<Attribute>