pub struct DropZoneProps<T: Clone + PartialEq + 'static> {
pub id: Option<ZoneId>,
pub label: Option<String>,
pub accepts: Option<Callback<T, bool>>,
pub edge: Option<EdgeSet>,
pub on_drop: EventHandler<DropOutcome<T>>,
pub attributes: Vec<Attribute>,
pub children: Element,
}Expand description
Properties for the DropZone component.
Fields§
§id: Option<ZoneId>Stable identity for this zone. Auto-generated if omitted.
label: Option<String>Human label for screen-reader announcements (“Over {label}”).
accepts: Option<Callback<T, bool>>Return false to reject a payload (zone won’t highlight or accept it).
edge: Option<EdgeSet>Track the zone edge nearest the pointer: EdgeSet::Vertical for
top/bottom (a vertical stack), EdgeSet::Horizontal for left/right,
EdgeSet::All for all four. Renders data-edge while hovered and
fills DropOutcome::edge. Off (absent, None) by default.
on_drop: EventHandler<DropOutcome<T>>Fired on a successful drop.
attributes: Vec<Attribute>§children: ElementImplementations§
Source§impl<T: Clone + PartialEq + 'static> DropZoneProps<T>
impl<T: Clone + PartialEq + 'static> DropZoneProps<T>
Sourcepub fn builder() -> DropZonePropsBuilder<((), (), (), (), (), (), ()), T>
pub fn builder() -> DropZonePropsBuilder<((), (), (), (), (), (), ()), T>
Create a builder for building DropZoneProps.
On the builder, call .id(...)(optional), .label(...)(optional), .accepts(...)(optional), .edge(...)(optional), .on_drop(...), .attributes(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of DropZoneProps.