Skip to main content
Bring your own drag-and-drop interactions.While these components are intended to help you create drag and drop experiences that align with our designs, they do not provide the actual drag-and-drop interactions. You should evaluate external libraries make the best choice for your needs.

Common Examples

import { Dnd } from "@servicetitan/anvil2";

Zone

The Dnd.Zone can be used to style an element as a drop zone.

Handle

The Dnd.Handle is an icon which helps users understand that something is draggable.

Handle Button

The Dnd.HandleButton is a button-wrapped icon which helps users understand that something is draggable. Use this if your draggable item contains other interactive elements.

Sort Line

The Dnd.SortLine indicates where an item will be dropped in a sortable list.The width of the line is based upon its nearest relatively positioned ancestor.This component should be used when you’re building an experience that is sortable in one dimension (i.e. vertical or horizontal lists). It is not suitable for sorting two-dimensional sorting (e.g. grids).

DndSort

If you’re not looking to create your own entire drag and drop solution, check to see if DndSort is capable of supporting your needs. It’s a pre-built composition that uses all of these Dnd components to cover many basic cases including: sorting a list, arranging items into groups, or both. Read more about that component here.

Best Practices

Draggables with interactivity

Do
If your draggable item has interactive elements, use the Dnd.HandleButton to initiate dragging.
Don’t
If your draggable item has interactive elements, don’t nest interactive elements.
Last modified on January 23, 2026