For AI agents: the complete documentation index is available at https://gultyayev.github.io/ngx-virtual-dnd/llms.txt, the full documentation bundle is available at https://gultyayev.github.io/ngx-virtual-dnd/llms-full.txt, and this page is available as Markdown at https://gultyayev.github.io/ngx-virtual-dnd/api/overview.md.

API overview

Everything is exported from ngx-virtual-dnd. Most apps only use the exports in the first two tables.

Start here

ExportUse it to
VirtualSortableListComponent (<vdnd-sortable-list>)Render a sortable virtual list: droppable, scroller and placeholder in one
DraggableDirective ([vdndDraggable])Make an item draggable
DroppableGroupDirective ([vdndGroup])Name the group that lets lists exchange items
DragPreviewComponent (<vdnd-drag-preview>)Render the element that follows the pointer (place it once)
DropEventRead where an item came from and where it was dropped
moveItem, reorderItems, applyMoveApply a drop to your signals or immutable state

Events and helpers

ExportUse it to
DragStartEventReact to a drag starting ((dragStart) on a draggable)
DragEndEventReact to every drag ending, dropped or not ((dragEnd) on a draggable)
PlaceholderMoveEventGive feedback on every placeholder step (haptics, announcements)
isNoOpDrop, insertAt, removeAtSkip drops back to the same place, or edit arrays immutably
DragStateServiceRead the current drag anywhere in the app, as signals
VDND_ANIMATION_CONFIGTurn on shift and drop animations
AutoScrollConfigType of the autoScrollConfig input

Other list building blocks

Use these instead of <vdnd-sortable-list> when you need your own markup or page-level scrolling. See Choosing a component.

ExportUse it to
DroppableDirective ([vdndDroppable])Make your own element a drop target
VirtualScrollContainerComponent (<vdnd-virtual-scroll>)Virtual scroller inside a vdndDroppable, with scrolling methods
ScrollableDirective ([vdndScrollable])Mark the element that scrolls, for page-level scrolling
VirtualContentComponent (<vdnd-virtual-content>)Virtual rows inside a vdndScrollable
ContentHeaderDirective ([vdndContentHeader])Measure a header above the rows of <vdnd-virtual-content>
VirtualForDirective (*vdndVirtualFor)Render only the visible items, as a structural directive
VirtualViewportComponent (<vdnd-virtual-viewport>)Self-scrolling container for *vdndVirtualFor

Advanced

Most apps never need these. They exist for custom containers and low-level integrations.

ExportWhat it is
AutoScrollServiceEdge scrolling during drags
PositionCalculatorService, ElementCloneService, KeyboardDragService, OverlayContainerServiceInternals exported for customization
PlaceholderComponent (<vdnd-placeholder>)A drop indicator you render yourself; the built-in lists do not use it
DragPlaceholderComponent (<vdnd-drag-placeholder>)The placeholder the built-in lists render
VirtualScrollStrategy, FixedHeightStrategy, DynamicHeightStrategyVirtual scroll math, for building your own container
VDND_SCROLL_CONTAINER, VDND_VIRTUAL_VIEWPORT, VDND_GROUP_TOKENTokens the library's containers provide
Template contexts and drag state typesTypes of template variables and of DragStateService values
END_OF_LIST, INITIAL_DRAG_STATEConstants. END_OF_LIST is deprecated