Reorder
Drag-to-reorder is the one interaction where the naive implementation is always wrong: re-render the list on every pointer move and you drop frames, lose focus and reset component state. BmotionReorderGroup previews the new order with transforms only - the list itself re-renders once, on release - so the drag stays smooth and the bound list is the single source of truth throughout.
Drag to reorder
Bind a list, give the items a stable key, and every row becomes draggable along the list
axis while its siblings spring out of the way. HandleSelector restricts the
gesture to a grip inside each row so the rest of it stays clickable and selectable, and
OnReorder fires once the new order has been committed.
Current order: One More Time → Digital Love → Harder Better Faster → Something About Us → Voyager
Committed reorders: 0
Horizontal lists
Axis="BmotionDragAxis.X" runs the same machinery sideways for a row of tabs, a
toolbar or a card rail. Only the axis changes - the displacement, the commit and the binding
all behave identically.
Current order: Draft → Review → Approved → Shipped
Grids
Axis="BmotionDragAxis.Both" reorders a layout that wraps - a CSS grid, a
flex-wrap row. The dragged tile takes the cell nearest its centre and the others close up
around it in reading order. From the keyboard, ←/→ move a held tile one place and
↑/↓ a row.
Current order: 🍎 🍐 🍊 🍋 🍌 🍉 🍇 🍓 🍒
Long lists
A list longer than its scroller scrolls while an item is held near its edge - faster the closer it gets -
and the item travels with it, so it can be carried past what is in view. It stops at the end of the list.
This is on by default; AutoScroll="false" turns it off. The page scrolls the same way when the
list itself is taller than the window.
The lift and the settle
Two parameters shape how a reorder feels. WhileDrag is the overlay the held item wears -
a slight scale-up by default - and takes any target, so it can lift, tilt or cast a shadow.
Transition is the spring the other items make way with and the dropped one settles on -
snappy by default; a softer one below lets the rows drift into place. The same overlay shows on an item
picked up from the keyboard.
Keyboard access
Every list here is keyboard-reorderable out of the box (Keyboard="false" turns it off). Tab
to a row and press Space or Enter to pick it up. The arrow keys move it while the
others make way, Space drops it - so does moving focus away - and Escape puts it
back. Each step is announced to screen readers through a live region. Announce words those
announcements: it is handed a BmotionReorderAnnouncement - the Event (picked up,
moved, dropped, cancelled), the Item, its 1-based Position and the
Count - and returns the sentence, so it can name the item or speak another language.
DefaultText is the library's own English wording. The list below names the track, and shows
what a screen reader would hear.
The group also follows any change to the bound list, so plain move-up / move-down buttons that
reorder Items directly (the ▲▼ controls in the first sample) animate exactly like a
drag. The same goes for any other source of order: a sort, a server push, an undo.