Skip to main content

Module hooks

Module hooks 

Source
Expand description

Hooks for providing and consuming the drag context.

Functions§

client_point
Client (viewport) coordinates of a native drag event as a Point. In-app drags don’t produce DragEvents; this serves the boundary modules (crate::files, crate::external) and custom native zones.
element_point
Element-relative coordinates of a native drag event as a Point. See client_point for when these apply.
use_dnd
Grab the nearest DndContext<T> from context.
use_dnd_provider
Provide a DndContext<T> (and its zone registry) to this component’s subtree. Call once, high up (or use the crate::core::components::DndProvider component).
use_zone_id
A stable, auto-generated ZoneId for this component instance.
use_zone_registry
Grab the zone registry (mounted drop zones, in order). Provided alongside the context by use_dnd_provider.