Expand description
OS file drops - the one drop type where the payload arrives in the native
event (evt.files()) rather than through the shared context.
Works on web and desktop. On desktop, dioxus::html::FileData::path
gives you the real filesystem path; on web you read contents with
read_bytes() / read_string() / byte_stream().
rsx! {
FileDropZone {
filter: FileFilter::new().extensions(["png", "jpg"]).max_size(5_000_000),
on_files: move |drop: FileDrop| async move {
for f in drop.files {
let bytes = f.read_bytes().await.unwrap();
// ...
}
},
"Drop images here"
}
}Re-exports§
pub use FileDropZone_completions::Component::FileDropZone;
Structs§
- File
Drop - A batch of dropped files plus where they landed.
- File
Drop Zone Props - Properties for the
FileDropZonecomponent. - File
Filter - Declarative acceptance rules for dropped files.
Enums§
- File
Rejection - Why a file was rejected by a
FileFilter.
Functions§
- File
Drop Zone - A zone that accepts files dragged in from the operating system.