dnd-kit
Skill1.7k starsChanged yesterdayMITView on GitHub
Use when writing, changing or debugging code that uses @dnd-kit - useDraggable, useSortable, DragDropProvider, a drag event handler, a modifier, a sensor or the Feedback plugin, in clip move and trim, track reorder or annotation edge drags - when a dragged element disappears, jumps, animates back or lands in the wrong place, when upgrading @dnd-kit, and when working on issue 796.
Trending
Quiet this year.thin dataabout the whole repository
Who's talking about naomiaro/waveform-playlist
- WebAudio/web-audio-api“Ability to change the playback rate of an AudioBufferSourceNode without affecting the pitch”GitHub · Apr 27, 2022 · 26 reactions
- A Hacker News story“Web Audio API Playlist”Hacker News · Jun 24, 2013 · 2 points
- gilpanal/waveform-playlist“Fetchtest”GitHub · Mar 20, 2024
- lifeart/sm-annotate“Add audio spectrogramm?”GitHub · Aug 2, 2023
- Micrufun/daw“Stream”GitHub · Jan 29, 2023
The biggest 5 of 11 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 11
Talked about on GitHub, Stack Overflow and Hacker News (11 times).
On GitHub · 8
- Apr 27, 2022Ability to change the playback rate of an AudioBufferSourceNode without affecting the pitch — WebAudio/web-audio-api26 reactions · 8 comments
- Mar 20, 2024Fetchtest — gilpanal/waveform-playlist0 reactions
- Aug 2, 2023Add audio spectrogramm? — lifeart/sm-annotate0 reactions · 1 comment
- Jan 29, 2023Stream — Micrufun/daw0 reactions
- May 13, 2022[Feature Request] — doublesymmetry/react-native-track-player0 reactions · 15 comments
3 more on GitHub
- Feb 6, 2022using waveform-playlist with opus-recorder — chris-rudmin/opus-recorder0 reactions · 1 comment
- Dec 27, 2021Waveform playlist: mixing audio tracks — Tonejs/Tone.js0 reactions · 2 comments
- Jul 24, 2020add https://github.com/naomiaro/waveform-playlist — amilajack/awesome-web-audio0 reactions
On Stack Overflow · 2
- Jan 30, 2021Play multiple wave at the same time0 votes
- Apr 4, 2018Customising waveform-playlist plugin0 votes · 1 answer
On Hacker News · 1
- Jun 24, 2013Web Audio API Playlist2 points
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- website/CLAUDE.mdCLAUDE.md
- browser-probesSkill
- dependency-updatesSkill
- design-proposalsSkill
- e2e-playwrightSkill
- mutation-testingSkill
- react-patternsSkill
- releaseSkill
- review-roundsSkill
- state-ownershipSkill
- translatable-stringsSkill
- unit-testingSkill
The file
Files
dnd-kit in this codebase
Installed: @dnd-kit/react / @dnd-kit/dom / @dnd-kit/abstract 0.5.0, as PEERS of browser, ui-components and annotations (never dependencies: see "Feedback is configured per entity"). A range bump of a 0.x peer is a major for all three (root CLAUDE.md, "Semantic Versioning").
Read the library, do not guess. A checkout of clauderic/dnd-kit is at /Users/naomiaro/Code/dnd-kit (newer than what is installed). Pin a read to the installed version's tag: git show '@dnd-kit/react@0.5.0^{commit}:packages/dom/src/core/plugins/feedback/Feedback.ts'. Key files: packages/dom/src/sortable/ (OptimisticSortingPlugin, SortableKeyboardPlugin), packages/dom/src/core/plugins/feedback/Feedback.ts, packages/abstract/src/core/plugins/registry.ts (register() overwrites an existing instance's options), packages/abstract/src/core/manager/events.ts (the event object types), packages/react/src/.
Issue #796 lists the three workarounds we carry for 0.5.0 sortables (the popover healer for feedback: 'move', the slot remount after a reorder drag, the late dragover) and asks for each to be checked against the latest release in a standalone page, and filed upstream only when it reproduces there. The workarounds themselves are described in packages/browser/notes/track-controls-and-reorder.md, "Track Reordering (#612)".
Events (0.5.0)
event.operation.position.deltaisundefinedin snapshots —@derivedgetters are non-enumerable and stripped bysnapshot(). Compute manually:position.current.x - position.initial.x.event.operation.position.currentis stale inonDragMove—move()dispatches before updatingposition.current(happens inqueueMicrotask). Useevent.to?.xfor the correct pointer position (to?: Coordinatesis typed on the dragmove event).event.operation.transform.xinonDragEndreflects the final post-modifier transform. Use for clip moves; for boundary trims, cache the last delta fromonDragMovein a ref.- Event types are event OBJECTS, not handler types (0.4+ redesign):
DragStartEvent/DragMoveEvent/DragEndEventfrom@dnd-kit/abstractare used directly as the handler parameter type. The 0.3-eraParameters<DragStartEvent>[0]collapses tonever(build error, not a runtime bug). - Feedback config is per-entity, never provider-level (0.4+ moved
feedbackout of the hook options intoplugins: [Feedback.configure({...})]).Clip.tsxdeclaresdropAnimation: nullon the clip-move draggable andfeedback: 'none'on trim handles itself;useTrackReorderHandle(SortableTrackControlsuntil #687) uses the FUNCTION formplugins: (defaults) => [...defaults, Feedback.configure({ feedback: 'move' })]so the sortable's defaultOptimisticSortingPlugin/SortableKeyboardPluginsurvive (a bare array replaces them and drag-commit silently stops working — guarded bytrackReorderHandleFeedbackPlugins.test.tsx). The formernoDropAnimationPluginsprovider helper was REMOVED: in 0.5 every entity that carries its own Feedback config re-registers the plugin withundefinedoptions (Draggableeffect →registry.plugins.register(plugin)→existingInstance.options = undefined), which wipes provider-level Feedback options the moment a clip mounts — provider-leveldropAnimation: nullis unreliable by construction. Per-entitydropAnimationtakes precedence over the plugin instance (Feedback.tsresolution order), so the entity-level declaration is the only robust one.sortable.tslikewise reads onlydraggable.pluginConfig(Feedback)?.feedbackfor its'move'handling — a provider-levelfeedbackcallback never reaches it. - Per-entity config matches
Feedbackby constructor identity (pluginConfigdoesdesc.plugin === plugin). Two copies of@dnd-kit/domin a bundle make'none'/'move'silently no-op — keep@dnd-kit/*as peers (neverdependencies) in every published package. - dnd-kit can send a
dragoverafter thedragendof a canceled drag. It set the reorder preview again for good (Escape mid-drag, 6 of 6 e2e runs on #687). A handler that publishes drag state checks that a drag is in progress (#796 tracks the dnd-kit workarounds). - dnd-kit 0.5.0 calls
onDragMoveandonDragEndinsidestartTransition(trackRenderingin itsDragDropProvider). A state update made from a handler is a transition update; auseSyncExternalStorepublish from the same handler renders synchronously. So "clear the preview and commit" on release shows one frame of the old geometry unless both run insideflushSync(#812, the trim release: without it the clip was drawn at[96000, 121000]). A unit test that calls a captured handler directly cannot see that frame: call it as dnd-kit does,act(() => startTransition(() => handler(event)))(dispatchinpackages/browser/src/__tests__/trimPreview.test.tsx), and the missingflushSyncfails the test.
Feedback is configured per entity
From packages/ui-components (Clip.tsx, AnnotationBox.tsx):
Pattern (@dnd-kit 0.5+): Feedback behavior is configured per-entity through the plugins hook option — useDraggable({ plugins: [Feedback.configure({ feedback: 'none' })] }) disables the Feedback plugin for that draggable (no fixed positioning, no CSS translate, no placeholder, no drop animation); plugins: [Feedback.configure({ dropAnimation: null })] keeps default feedback but skips the snap-back animation on drop. Feedback comes from @dnd-kit/dom (declared optional peer alongside @dnd-kit/react). Hoist the arrays to module constants — useDraggable re-assigns draggable.plugins on reference change.
0.3 → 0.5 trap: the old top-level feedback: 'none' hook option was REMOVED upstream and is silently ignored at runtime (type error only). The Feedback plugin reads source.pluginConfig(Feedback), which matches the Feedback constructor by identity — a duplicated @dnd-kit/dom copy in a consumer bundle makes 'none' silently no-op too, which is why it's a peer, never a dependency. clipFeedbackPlugins.test.tsx reads the config back from the real registered entities rather than asserting on props.
Applied in: Clip.tsx (trim handles 'none', clip-move dropAnimation: null), AnnotationBox.tsx (start/end handles 'none').
Annotation resize handles
From packages/annotations:
Annotation boundary resize handles disable the Feedback plugin per-entity: useDraggable({ plugins: [Feedback.configure({ feedback: 'none' })] }) (Feedback from @dnd-kit/dom, a declared peer; hoist the array to a module constant for a stable reference). @dnd-kit 0.5 removed the old top-level feedback hook option — it is silently ignored at runtime, so annotationBoxFeedbackPlugins.test.tsx reads the config back from the real registered entity. Resize visual feedback comes from React state updates repositioning the annotation, not CSS translate.
Where the rest is
| What | Where |
| Clip move and trim handlers, stable handlers and modifiers, snap-to-grid, where clip interaction options live | packages/browser/notes/clip-drag-and-snap.md |
| Track reorder: the sortable, the popover healer, the remount after a drag, the reorder preview | packages/browser/notes/track-controls-and-reorder.md |
| Annotation edge drag: preview source, one report per drag | packages/browser/notes/annotations.md |
| The data each clip draggable carries | packages/ui-components/CLAUDE.md, "Clip Draggable Data Shape" |
| Registering a parent-owned element with dnd-kit from a child (a passive effect, not a layout effect) | skill react-patterns, "A child's layout effect runs before React attaches its parent's ref" |
| jsdom: the ResizeObserver stub that must be imported first; do not press a draggable element | skill unit-testing, "jsdom and React" |
Playwright: fractional pointer positions reach dnd-kit; checking that a drop animation is off with document.getAnimations() | skill e2e-playwright, "Pointer and input" |
The count of aria-roledescription="draggable" attributes differs between loads | skill browser-probes, "The probe scripts" |
| Undo pressed during a drag lands the clip away from the pointer (both editors) | issue #848 |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

