Angular Sortable List and Drag and Drop | ng-hub-ui-sortable

Angular sortable list and drag-and-drop utilities for arrays, FormArray integration, Signals workflows and connected lists.

API reference

Here's the full contract for sortable: everything you can bind, listen to, project and theme, gathered in one place. Wire up what you need and style what you want — it's standalone and signal-friendly.

Inputs

Dial sortable in with 13 inputs. Bind them like any Angular @Input.

NameTypeDefaultDescription
hubSortableRequiredT[] | FormArray | WritableSignal<T[]>Data bound to the sortable container — a plain array, a reactive `FormArray` or a writable signal. Stays in sync with drag-and-drop operations.
optionsOptionsFull SortableJS options object. Every SortableJS option can also be bound directly as its own input (for example `handle`, `animation` or `group`).
autoUpdateArraybooleantrueWhen `true` (default) the directive mutates the bound array automatically after each drag. Set it to `false` for manual control and update the array yourself.
cloneFunction(item: T) => TFactory used to clone an item when the group is configured in `pull: 'clone'` mode.
containerstringCSS selector of the nested element that should become sortable when the host wraps the actual list.
groupOptions['group']Group name or configuration object used to connect several lists and control which ones can give or receive items.
sortbooleanEnables or disables reordering of items within the list.
handlestringCSS selector of the element inside each item that starts the drag, leaving the rest interactive.
draggablestringCSS selector that restricts which child elements can be dragged.
filterstring | ((event, target, sortable) => boolean)CSS selector (or predicate) marking elements that cannot be dragged.
disabledbooleanDisables the sortable behaviour without removing the directive.
animationnumberDuration in milliseconds of the reordering animation.
ghostClassstringCSS class applied to the drop placeholder shown while dragging.

Outputs

React to what sortable does — 13 events to hook your logic onto.

NameTypeDescription
initSortableEmitted once the underlying SortableJS instance has been created.
startSortableEventEmitted when a drag operation starts.
endSortableEventEmitted when a drag operation ends, regardless of the result.
addSortableEventEmitted when an item is dropped into this list from another one.
updateSortableEventEmitted when an item changes position within the same list.
sortEventSortableEventEmitted whenever the list order changes (after `add` or `update`).
removeSortableEventEmitted when an item leaves this list towards another one.
filterEventSortableEventEmitted when a filtered (non-draggable) item is attempted to be dragged.
changeSortableEventEmitted when the list changes due to an add or remove operation.
chooseSortableEventEmitted when an item is chosen (pointer down).
unchooseSortableEventEmitted when an item is released without being dragged.
cloneSortableEventEmitted when an item is cloned in clone mode.
moveSortableMoveEventPayloadEmitted continuously while dragging; its return value can control whether the move is allowed.

Templates

No templates documented yet.

CSS variables

No CSS variables documented yet.

Styling and theming

No styling examples are documented yet. This section will include customization recipes and theming examples.