![Drag and drop example](https://upload.wikimedia.org/wikipedia/commons/5/5e/Drag_and_drop_example.gif)
In
computer
A computer is a machine that can be programmed to Execution (computing), carry out sequences of arithmetic or logical operations (computation) automatically. Modern digital electronic computers can perform generic sets of operations known as C ...
graphical user interface
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
s, drag and drop is a
pointing device gesture
In computing, a pointing device gesture or mouse gesture (or simply gesture) is a way of combining pointing device or finger movements and clicks that the software recognizes as a specific computer event and responds to accordingly. They can be ...
in which the
user
Ancient Egyptian roles
* User (ancient Egyptian official), an ancient Egyptian nomarch (governor) of the Eighth Dynasty
* Useramen, an ancient Egyptian vizier also called "User"
Other uses
* User (computing), a person (or software) using an ...
selects a virtual object by "grabbing" it and
dragging
In computing, a pointing device gesture or mouse gesture (or simply gesture) is a way of combining pointing device or finger movements and clicks that the software recognizes as a specific computer event and responds to accordingly. They can be ...
it to a different location or onto another virtual object. In general, it can be used to invoke many kinds of actions, or create various types of associations between two
abstract object
In metaphysics, the distinction between abstract and concrete refers to a divide between two types of entities. Many philosophers hold that this difference has fundamental metaphysical significance. Examples of concrete objects include plants, hum ...
s.
As a feature, drag-and-drop support is not found in all
software
Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work.
At the lowest programming level, executable code consists ...
, though it is sometimes a fast and easy-to-learn technique. However, it is not always clear to users that an item can be dragged and dropped, or what is the command performed by the drag and drop, which can decrease usability.
Actions
The basic sequence involved in drag and drop is:
* Move the
pointer to the object
* Press, and hold down, the button on the
mouse
A mouse ( : mice) is a small rodent. Characteristically, mice are known to have a pointed snout, small rounded ears, a body-length scaly tail, and a high breeding rate. The best known mouse species is the common house mouse (''Mus musculus' ...
or other
pointing device
A pointing device is a human interface device that allows a user to input spatial (i.e., continuous and multi-dimensional) data to a computer. CAD systems and graphical user interfaces (GUI) allow the user to control and provide data to ...
, to "grab" the object
* "Drag" the object to the desired location by moving the pointer to this one
* "Drop" the object by releasing the button
Dragging requires more physical effort than moving the same pointing device without holding down any buttons. Because of this, a user cannot move as quickly and precisely while dragging (see
Fitts' law
Fitts's law (often cited as Fitts' law) is a predictive model of human movement primarily used in human–computer interaction and ergonomics. The law predicts that the time required to rapidly move to a target area is a function of the ratio betw ...
). However, drag-and-drop operations have the advantage of thoughtfully chunking together two operands (the object to drag, and the drop location) into a single action.
Extended dragging and dropping (as in graphic design) can stress the mousing hand.
A design problem appears when the same button
selects and drags items. Imprecise movement can cause an attempt to select an object to register as a dragging motion.
Another problem is that the target of the dropping can be hidden under other objects. The user would have to stop the dragging, make both the source and the target visible and start again. In classic Mac OS the top-of-screen menu bar served as a universal "drag cancel" target. This issue has been dealt with in
Mac OS X
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
with the introduction of
Exposé
Expose, exposé, or exposed may refer to:
News sources
* Exposé (journalism), a form of investigative journalism
* '' The Exposé'', a British conspiracist website
Film and TV Film
* ''Exposé'' (film), a 1976 thriller film
* ''Exposed'' (1932 ...
.
In Mac OS
Drag and drop, called click and drag at the time, was used in the
original Macintosh to manipulate files (for example, copying them between disks or folders.).
System 7
System 7, codenamed "Big Bang", and also known as Mac OS 7, is a graphical user interface-based operating system for Macintosh computers and is part of the classic Mac OS series of operating systems. It was introduced on May 13, 1991, by Apple Co ...
added the ability to open a document in an application by dropping the document icon onto the application's icon.
In
System 7.5, drag and drop was extended to common clipboard operations like copying or moving textual content within a document. Content could also be dragged into the filesystem to create a "clipping file" which could then be stored and reused.
For most of its history Mac OS has used a
single button mouse with the button covering a large portion of the top surface of the mouse. This may mitigate the ergonomic concerns of keeping the button pressed while dragging.
In OS/2
The
Workplace Shell
The Workplace Shell (WPS) is an object-oriented desktop shell (also called desktop environment) produced by IBM's Boca Raton development lab for OS/2 2.0. It is based on Common User Access and made a radical shift away from the Program Manager ...
of
OS/2
OS/2 (Operating System/2) is a series of computer operating systems, initially created by Microsoft and IBM under the leadership of IBM software designer Ed Iacobucci. As a result of a feud between the two companies over how to position OS/2 ...
uses dragging and dropping extensively with the
secondary mouse button, leaving the primary one for selection and clicking.
Its use like that of other advanced
Common User Access
Common User Access (CUA) is a standard for user interfaces to operating systems and computer programs. It was developed by IBM and first published in 1987 as part of their Systems Application Architecture. Used originally in the MVS/ESA, VM/CMS, ...
features distinguished native OS/2 applications from
platform-independent
In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform software ...
ports.
In HTML
The
HTML5
HTML5 is a markup language used for structuring and presenting content on the World Wide Web. It is the fifth and final major HTML version that is a World Wide Web Consortium (W3C) recommendation. The current specification is known as the HTML ...
working draft specification includes support for drag and drop. HTML5 supports different kinds of dragging and dropping features including:
* Drag and Drop texts and HTML codes
* Drag and Drop HTML elements
* Drag and Drop files
Based on needed action, one of the above types can be used. Note that when an HTML element is dragged for moving its current position, its ID is sent to the destination parent element; so it sends a text and can be considered as the first group.
Google's web-based e-mail application
Gmail
Gmail is a free email service provided by Google. As of 2019, it had 1.5 billion active users worldwide. A user typically accesses Gmail in a web browser or the official mobile app. Google also supports the use of email clients via the POP an ...
supports drag-and-drop of images and attachments in the latest
Google Chrome
Google Chrome is a cross-platform web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS ...
browser and Apple's
Safari
A safari (; ) is an overland journey to observe wild animals, especially in eastern or southern Africa. The so-called "Big Five" game animals of Africa – lion, leopard, rhinoceros, elephant, and Cape buffalo – particularly form an importa ...
(5.x). Google Images permits users to drag and drop image files into a browser to perform a
reverse image search
Reverse image search is a content-based image retrieval (CBIR) query technique that involves providing the CBIR system with a sample image that it will then base its search upon; in terms of information retrieval, the sample image is very usefu ...
.
On a touch screen
Touch screen interfaces also include drag and drop, or more precisely, long press, and then drag, e.g. on the
iPhone or
Android home screens.
iOS 11
iOS 11 is the iOS version history, eleventh major release of the iOS mobile operating system developed by Apple Inc., being the successor to iOS 10. It was announced at the company's Apple Worldwide Developers Conference, Worldwide Developers C ...
implements a drag-and-drop feature which allows the user to touch items (and tap with other fingers to drag more) within an app or between apps on
iPad
The iPad is a brand of iOS and iPadOS-based tablet computers that are developed by Apple Inc. The iPad was conceived before the related iPhone but the iPhone was developed and released first. Speculation about the development, operating s ...
s. On iPhones, the functionality is only available within the same app that the user started the drag.
In end-user programming
Drag and drop is considered an important program construction approach in many
end-user development
End-user development (EUD) or end-user programming (EUP) refers to activities and tools that allow end-users – people who are not professional software developers – to program computers. People who are not professional developers can use EUD ...
systems. In contrast to more traditional, text-based programming languages, many end-user programming languages are based on visual components such as tiles or icons that are manipulated by end users through drag-and-drop interfaces.
AgentSheets
AgentSheets was one of the first modern block-based programming language for kids. The idea of AgentSheets was to overcome syntactic challenges found in common text-based programming languages by using drag and drop mechanisms conceptualizing com ...
, a programming environment for kids, introduced the modern notion of drag and drop blocks programming providing 4 core affordances: 1) Blocks that are end-user composable, 2) blocks are end-user editable, 3) blocks can be nested to represent tree structures, 4) blocks are arranged geometrically to define syntax. Drag and drop is also featured in many shader editing programs for graphics tools, such as
Blender
A blender (sometimes called a mixer or liquidiser in British English) is a kitchen appliance, kitchen and laboratory appliance used to mix, crush, purée or emulsion, emulsify food and other substances. A stationary blender consists of a blender ...
.
Drag and drop also features in some video game engines, including
Unreal Engine
Unreal Engine (UE) is a 3D computer graphics game engine developed by Epic Games, first showcased in the 1998 first-person shooter game ''Unreal''. Initially developed for PC first-person shooters, it has since been used in a variety of genres ...
,
GameMaker Studio
GameMaker (originally Animo, Game Maker ''(until 2011)'' and GameMaker Studio) is a series of cross-platform game engines created by Mark Overmars in 1999 and developed by YoYo Games since 2007. The latest iteration of ''GameMaker'' released ...
,
Construct 2 and, with expansion,
Unity
Unity may refer to:
Buildings
* Unity Building, Oregon, Illinois, US; a historic building
* Unity Building (Chicago), Illinois, US; a skyscraper
* Unity Buildings, Liverpool, UK; two buildings in England
* Unity Chapel, Wyoming, Wisconsin, US; a h ...
.
Examples
A common example is dragging an icon on a virtual
desktop
A desktop traditionally refers to:
* The surface of a desk (often to distinguish office appliances that fit on a desk, such as photocopiers and printers, from larger equipment covering its own area on the floor)
Desktop may refer to various compu ...
to a special
trashcan
A waste container, also known as a dustbin, garbage can, and trash can is a type of container that is usually made out of metal or plastic. The words "rubbish", "basket" and "bin" are more common in British English usage; "trash" and "can" a ...
icon
An icon () is a religious work of art, most commonly a painting, in the cultures of the Eastern Orthodox, Oriental Orthodox, and Catholic churches. They are not simply artworks; "an icon is a sacred image used in religious devotion". The most ...
to delete a
file
File or filing may refer to:
Mechanical tools and processes
* File (tool), a tool used to ''remove'' fine amounts of material from a workpiece
**Filing (metalworking), a material removal process in manufacturing
** Nail file, a tool used to gent ...
.
Further examples include:
* Dragging a data
file
File or filing may refer to:
Mechanical tools and processes
* File (tool), a tool used to ''remove'' fine amounts of material from a workpiece
**Filing (metalworking), a material removal process in manufacturing
** Nail file, a tool used to gent ...
onto a
program
Program, programme, programmer, or programming may refer to:
Business and management
* Program management, the process of managing several related projects
* Time management
* Program, a part of planning
Arts and entertainment Audio
* Progra ...
icon
An icon () is a religious work of art, most commonly a painting, in the cultures of the Eastern Orthodox, Oriental Orthodox, and Catholic churches. They are not simply artworks; "an icon is a sacred image used in religious devotion". The most ...
or window for viewing or processing. For instance, dropping an icon that represents a text file into a Microsoft Word window signifies "Open this document as a new document in Word"
* Moving or copying
files to a new location/directory/folder,
* Adding objects to a list of objects to be processed,
* Rearranging
widgets in a
graphical user interface
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
to customize their layout,
* Dragging an attribute onto an object to which the command is to be applied,
** e.g. dragging a color onto a graphical object to change its color,
* Dragging a tool to a canvas location to apply the tool at that location,
* Creating a
hyperlink
In computing, a hyperlink, or simply a link, is a digital reference to data that the user can follow or be guided by clicking or tapping. A hyperlink points to a whole document or to a specific element within a document. Hypertext is text wit ...
from one location or word to another location or document.
* Most word processors allow dragging selected text from one point to another.
* Dragging a series of code blocks such as in
Blender
A blender (sometimes called a mixer or liquidiser in British English) is a kitchen appliance, kitchen and laboratory appliance used to mix, crush, purée or emulsion, emulsify food and other substances. A stationary blender consists of a blender ...
for designing shaders and materials.
See also
*
Mouse gesture
In computing, a pointing device gesture or mouse gesture (or simply gesture) is a way of combining pointing device or finger movements and clicks that the software recognizes as a specific computer event and responds to accordingly. They can be ...
*
Point and click
Point and click are the actions of a computer user moving a pointer to a certain location on a screen (''pointing'') and then pressing a button on a mouse, usually the left button (''click''), or other pointing device. An example of point and cli ...
*
Snap (computer graphics)
References
{{reflist
User interface techniques