pub struct DraggableProps<T: Clone + PartialEq + 'static> {
pub payload: T,
pub zone: Option<ZoneId>,
pub effect: DropEffect,
pub disabled: bool,
pub threshold: f64,
pub label: Option<String>,
pub on_drag_start: Option<EventHandler<()>>,
pub on_drag_end: Option<EventHandler<bool>>,
pub attributes: Vec<Attribute>,
pub children: Element,
}Expand description
Properties for the Draggable component.
Fields§
§payload: TThe value delivered to whichever DropZone receives this drag.
zone: Option<ZoneId>The zone this item currently lives in (reported in DropOutcome::from).
effect: DropEffectDrop effect. Defaults to Move.
disabled: boolDisable dragging without unmounting.
threshold: f64Movement in CSS px before a pointer press becomes a drag.
label: Option<String>Human label used in screen-reader announcements (“Picked up {label}”).
on_drag_start: Option<EventHandler<()>>Fired when a drag begins.
on_drag_end: Option<EventHandler<bool>>Fired when the drag ends; true if a zone consumed the payload,
false if it was cancelled.
attributes: Vec<Attribute>§children: ElementImplementations§
Source§impl<T: Clone + PartialEq + 'static> DraggableProps<T>
impl<T: Clone + PartialEq + 'static> DraggableProps<T>
Sourcepub fn builder() -> DraggablePropsBuilder<((), (), (), (), (), (), (), (), (), ()), T>
pub fn builder() -> DraggablePropsBuilder<((), (), (), (), (), (), (), (), (), ()), T>
Create a builder for building DraggableProps.
On the builder, call .payload(...), .zone(...)(optional), .effect(...)(optional), .disabled(...)(optional), .threshold(...)(optional), .label(...)(optional), .on_drag_start(...)(optional), .on_drag_end(...)(optional), .attributes(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of DraggableProps.