LogoLogo
ExamplesExperimentalCommunityGithub
  • Overview
  • Introduction
    • Installation
    • Quick start
  • API Documentation
    • DndContext
      • Collision detection algorithms
      • useDndContext
      • useDndMonitor
    • Droppable
      • useDroppable
    • Draggable
      • useDraggable
      • Drag Overlay
    • Sensors
      • Pointer
      • Mouse
      • Touch
      • Keyboard
    • Modifiers
  • Presets
    • Sortable
      • Sortable Context
      • useSortable
  • Guides
    • Accessibility
Powered by GitBook
On this page
Edit on Git
  1. API Documentation
  2. DndContext

useDndContext

For advanced use-cases, for example, if you're building your own presets on top of @dnd-kit/core, you may want to have access to the internal context of <DndContext> that the useDraggable and useDroppable have access to.

import {useDndContext} from '@dnd-kit/core';

function CustomPreset() {
  const dndContext = useDndContext();
}

If you think the preset you're building could be useful to others, feel free to open up a PR for discussion in the dnd-kit repository.

Last updated 4 years ago