Tesserae

File Selector & Drop Area

Description

The File Selector and File Drop Area components allow users to select files from their device. The File Selector is typically used for selecting a single file via a standard file dialog, often styled as an input field. The File Drop Area provides a drag-and-drop zone where users can drop one or multiple files.

Usage

File Selector

Use FileSelector() to create a file input. You can set a placeholder, restrict accepted file types, and handle the selection event.

File Drop Area

Use FileDropArea() to create a drop zone. You can enable multiple file selection and handle the drop event.

Methods (FileSelector)

  • SetPlaceholder(string text)
    • Sets the placeholder text displayed when no file is selected.
  • SetAccepts(string accept)
    • Sets the accept attribute (e.g., ".png, image/*") to filter allowed file types.
  • Required()
    • Marks the input as required.
  • OnFileSelected(FileSelectedHandler handler)
    • Registers a callback invoked when a file is selected. The handler receives the FileSelector instance and the event.
    • Handler signature: void Handler(FileSelector sender, Event e)

Properties (FileSelector)

  • SelectedFile
    • Gets the currently selected File object (from H5.Core.dom).

Methods (FileDropArea)

  • Multiple()
    • Allows multiple files to be dropped or selected.
  • OnFilesDropped(FilesDroppedHandler handler)
    • Registers a callback invoked when files are dropped.
    • Handler signature: void Handler(IList<File> files, Event e)

Samples

File Selector and Drop Area Sample

This sample demonstrates both components.

© 2026 Tesserae. All rights reserved.