pub fn DropZone<T: Clone + PartialEq + 'static>(_: DropZoneProps<T>) -> ElementExpand description
A region that accepts drags carrying T.
Handles the HTML5 boilerplate for you: preventDefault on dragover,
enter/leave depth counting (so child elements don’t cause hover flicker),
and acceptance filtering.
Styling hooks: while an acceptable drag is in flight anywhere, the div
carries data-active="true" (reveal your drop targets); while that drag
hovers this zone it also carries data-over="true" (highlight it).
Both are absent otherwise, so presence-based selectors (CSS
[data-over], Tailwind data-over:ring-2) work directly. Driven by the
shared context, so they light up for pointer, touch and keyboard drags
alike.
§Props
For details, see the props struct definition.
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
falseto reject a payload (zone won’t highlight or accept it).on_drop:EventHandler<DropOutcome<T>>Fired on a successful drop.
attributes:Vec<Attribute>children:Element