Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Drag Source
  3. Usage

DragSource

Usage

DragSource and DragPreview connect dnd-kit to the design system without importing dnd-kit in @prepared911/ui. The remote owns DndContext, sensors, and useDraggable.
When to use
  • Radio dispatch rows, headers, or cards that are not Item hosts.
  • as="li" when list semantics need a native li but the row is not an Item.
When not to use
  • Item rows in ItemGroup (pass dnd-kit props to Item instead).
  • Native HTML5 drag or file drops (DropTarget).
Host behavior
The host suppresses text selection while enabled, paints the design-system focus ring on :focus-visible, and sets data-disabled when disabled is true. While data-dragging, it shows a hover wash and a dashed inner outline (no layout shift) without opacity so labels stay readable; keyboard focus still shows the focus ring. A disabled host drops drag listeners and accessibility attributes from dragAttributes so it is not a tab stop.
Localization
Pass localized accessibility on DndContext and set aria-roledescription (and described-by targets) on dragAttributes. dnd-kit's built-in instructions and announcements are English only.
Drag handle
Use an icon-only Button with setActivatorNodeRef and the filtered listener props when only a handle should start the drag.
Previous
Data list / Accessibility
Next
DragSource / Accessibility
On this page
When to use
When not to use
Host behavior
Localization
Drag handle