FileUpload

Form

Takes a block

File input; handle the chosen files in on change.

FileUpload(accept: …, label: …, multiple: …) { … }

Example

FileUpload(accept: "image/*", label: "Choose a picture") { on change(e) { log(e.target.files[0].name) } }

Renders with the class wf-file-upload, stable across releases, so a stylesheet may target it.

Props of FileUpload
Prop Type Meaning
accept: String

Accepted types, e.g. image/* or .pdf,.doc

label: String

Visible label; also the control's accessible name

multiple: Bool

Accept several files

disabled: Bool

Whether the control is inert

Attribute families: global, aria, data, input. Plus the universal props on every element: animate:, exit:, speed:, class:, ref:.