Drag and Drop – Data Transfer

Foundations / Interaction / Drag and Drop / Drag and Drop – Data Transfer

Intro

The drag and drop interaction can occur between components within an application or across different applications. This means users can transfer data from a source component to a target component, which may involve transforming the data format or data uploading if the transfer is across applications.

When to Use

Do

Use drag and drop for data transfer:

  • If the drag and drop interaction occurs across components or applications.
  • To upload files into a target application.

Don't

Don’t use drag and drop for data transfer:

  • If the drag and drop interaction is performed within a single component, such as dropping one item between others or onto another to create hierarchies. For more information, see Drag and Drop - Reorder.

Anatomy

Data transfer – anatomy

  1. Source component: The component from which the draggable elements are dragged out.
  2. Draggable element: An item that can be dragged to transfer.
  3. Target component: The component that hosts the dragged elements.
  4. Initial position: The origin or starting point from where the item is dragged.
  1. Ghost element: The visual representation of the dragged element.
  2. Drop target: The destination area where the draggable element is dropped.
  3. Cancel area: Any area not defined as a drop target.

Behavior and Interaction

Contextual Awareness

Contextual awareness is required in data transfer interactions. This means the system needs to understand and respond appropriately to the context in which a user performs a drag and drop action. This includes recognizing the nature of the item being dragged, the target destination, and the intent or purpose behind the action, and then providing feedback or functionality that aligns with that context.

Cursors

When the mouse hovers over the draggable element, the cursor changes to a grab cursor or to а pointing cursor if the draggable element itself has a separate interaction triggered by a click, indicating that user can drag this element. When the left mouse button is pressed down on the draggable element, the cursor changes to the grabbing cursor, indicating that the element is grabbed and ready for dragging.

If the element is moved to a cancel area, a not-allowed or no-drop cursor appears.

For the data uploading use case, the copy cursor appears as soon as the item is dragged into the area of the target component.

Empty States

When the target component is empty, a ‘no data’ text or an illustrated message is helpful to indicate that items can be added into the component via a drag-and-drop interaction.

Additional information, such as maximum file size, can be included in the ‘no data’ text or illustrated message.

For more information, see Empty States Guideline.

Empty states for various data transfer use cases – examples

Drop Target

A. When reordering is enabled for the target component:

B. When reordering is not enabled for the target component:

Drag and drop – data transfer: drop target indicators – A. Reorderable target – the drop target indicator appears between list items; B. Fixed target – the indicator covers the full area and items are inserted in a predefined location.

Data Format Transformation

The data format needs to be transformed according to the format in the target component.

Drag and drop – data transfer: dragging an item from a list (A) and dropping it into a grid list (B).

File Uploading

When users drag files from the local operating system and drop them into the target application, it enables them to upload files to the designated component within the application.

There are several components that allow data transfer and file upload via drag and drop, such as file uploader, table, list and grid list. Below is an example of using a list as the target component for file uploading.

Uploading files (A) by dragging them into a list and showing their placement during the drop (B), and after drop completion (C).

Canceling

Users can cancel a drag-and-drop operation in two ways: by dropping items into a designated cancel area or by pressing the Esc key during the interaction.

Dropping items in the cancel area allows users to abandon the current data transfer and revert items to their initial positions without making changes.

If the items are dragged into the possible drop area, pressing the Esc key cancels the action and snaps the items back to their initial positions.

Drag and drop – data transfer canceling