Expand description
Ready-made components over the shared drag context.
ⓘ
rsx! {
DndProvider::<Card> {
Draggable::<Card> { payload: card.clone(), "Drag me" }
DropZone::<Card> {
on_drop: move |outcome: DropOutcome<Card>| { /* ... */ },
"Drop here"
}
}
}Re-exports§
pub use DndProvider_completions::Component::DndProvider;pub use Draggable_completions::Component::Draggable;pub use DropZone_completions::Component::DropZone;pub use DragOverlay_completions::Component::DragOverlay;
Structs§
- DndProvider
Props - Properties for the
DndProvidercomponent. - Drag
Overlay Props - Properties for the
DragOverlaycomponent. - Draggable
Props - Properties for the
Draggablecomponent. - Drop
Zone Props - Properties for the
DropZonecomponent. - Parent
Zone - Context marker a
DropZoneprovides so zones nested inside it can discover their parent — powering hierarchical keyboard traversal with no configuration.
Functions§
- DndProvider
- Provides a
DndContext<T>to its children. - Drag
Overlay - Renders its children pinned to the pointer while a drag is in flight — a custom “ghost” that follows the cursor.
- Draggable
- Wraps its children in a
div[draggable]and pushespayloadinto the shared context on drag start. - Drop
Zone - A region that accepts drags carrying
T.