Skip to main content

Module file_picker_field

Module file_picker_field 

Source
Expand description

FilePickerField — a text-input preset for path entry with a Browse button.

Combines a TextInput with a trailing IconButton (the folder/browse glyph) that opens a native file dialog and writes the chosen path back into the bound Signal<String>. The three FilePickerKind variants map to the three single-result dialog modes: open a file, pick a folder, or save a file. Multi-file selection does not fit the “one editable line” pattern; use the file-dialog API directly for that.

// Requires ctx.signal() — shown as ignore per convention.
let path = ctx.signal(String::new());
let _f = FilePickerField::new(path.clone())
    .kind(FilePickerKind::OpenFile)
    .add_filter("Images", &["png", "jpg"])
    .placeholder(lit!("Choose a file…"));

Structs§

FilePickerField
A single-line path entry field with a trailing Browse button that invokes the native file dialog and writes the chosen path back into the bound Signal<String>.

Enums§

FilePickerKind
Which file-dialog kind the trailing button opens.