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
previewComponentinDragSourceComponent.
Import
import { DndModule } from 'ngx-builder-dnd';Selector
ngx-drag-preview
API Reference
Inputs
| Name | Default | Description |
|---|---|---|
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
- Drag Source Component - Represents a single draggable item.
- Drag Drop Zone - Combines drag and drop logic into a unified zone.