Skip to main content

Drag Preview

Overview​

The DragPreviewComponent is a simple Angular component used as the default drag preview for draggable items. It is automatically used inside the DragSourceComponent whenever no custom preview component is provided.

  • Displays a minimal preview for a draggable item.
  • Can be replaced by providing a previewComponent in DragSourceComponent.

Import​

import { DndModule } from 'ngx-builder-dnd';

Selector​

ngx-drag-preview

API Reference​

Inputs​

NameDefaultDescription
imageUrl: string-The URL of the image displayed in the drag preview.

Example​

<ngx-drag-preview [imageUrl]="imageUrl"></ngx-drag-preview>

This will render a draggable preview with an image. If you are using the DragSourceComponent, this preview is automatically applied unless you provide a previewComponent.


See Also​