SortableList

A list whose items can be reordered by dragging, or from the keyboard.

With focus on an item, Alt + Up and Alt + Down move it one position; Alt + Home and Alt + End move it to an end. Every reorder is announced to assistive tech through a live region.

Structure

<SortableList &items={$state.items} ariaLabel="Steps">
	<SortableListItem item={item} index={i}>
		{item.name}
	</SortableListItem>
</SortableList>

With no children, the items are rendered automatically. getItemLabel supplies their text, and getItemValue supplies stable keys for custom items.

Demo