Drag and drop
cursor: alias in CSS: the make-a-shortcut cursor
alias says 'drop here and you create a shortcut or link to the thing, not a move or a copy'. It shows the arrow with a small curved-arrow badge.
cursor: alias; Move your mouse over this box Cursors only appear with a mouse or trackpad. Open this page on a computer to see this one. What it shows
An arrow with a small shortcut badge (a curved arrow). Windows has no role for it, so Chrome, Edge and Firefox draw their own. macOS uses its Drag link cursor.
Usage
When to use it
Use it for
- Drops that create a reference: linking a document to a task, adding a song to a playlist, pinning a page to a sidebar.
- A 'create link' mode while a modifier key is held during a drag, the way desktop file managers do it.
- Drop zones for bookmarks or favourites, where the original stays exactly where it was.
Avoid it for
- Normal links. They keep the hand.
- Drops that move or duplicate the item. Use move or copy.
Code
Copy the snippet
.playlist.is-drop-target { cursor: alias; } <div class="playlist is-drop-target">Drop a song here to add it to the playlist</div> Support
Browsers and systems
| Browser | Support |
|---|---|
| Chrome | 1 |
| Edge | 12 |
| Firefox | 1.5 |
| Safari | 3 |
| Safari on iOS | no |
| Chrome on Android | 18 |
| System | Matching cursor |
|---|---|
| Windows role | none (browser-supplied) |
| Windows file | none |
| macOS | Drag link |
Watch out
Gotchas
- During native HTML drag and drop the system controls the cursor. Set dataTransfer.dropEffect = 'link' in dragover rather than relying on CSS.
- Drags you build with pointer events do follow CSS, so set alias on the drop target, or on html while the drag is over it.
FAQ
Questions
- What does cursor: alias mean?
- That an alias, shortcut or link will be created where you drop. An arrow with a curved arrow badge is the usual look.
- Why does my alias cursor not show during drag and drop?
- With the HTML Drag and Drop API the operating system draws the drag cursor and ignores CSS. Set event.dataTransfer.dropEffect = 'link' in your dragover handler instead.
- Is there a Windows alias cursor?
- Not among the 17 Windows cursor roles. Chrome, Edge and Firefox bring their own image.
More