SortableList (drag and drop)
Reorder by dragging, or focus a row's handle and press Up / Down. Items need a unique key; onChange receives the new order.
- Plan
- Steal the moon
- Eat bananas
Props
items{ key, label?, ... }[]Items with a unique
key.onChange(items) => voidCalled with the new order.
renderItem(item, index) => ReactNodeRenders a row’s content.
labelstringDefault:'Sortable list'Accessible name.
classNamestringDefault:''Extra classes for the root element.
| Prop | Type | Default | Description |
|---|---|---|---|
items | { key, label?, ... }[] | – | Items with a unique key. |
onChange | (items) => void | – | Called with the new order. |
renderItem | (item, index) => ReactNode | – | Renders a row’s content. |
label | string | 'Sortable list' | Accessible name. |
className | string | '' | Extra classes for the root element. |