Skip to content

Inputs

FileInput

Bit.BlazorUI

BitFileInput lets the user hand files to the app - through the file dialog, by dropping them onto it or by pasting them - without uploading anything. Each file surfaces in C# as a BitFileInputInfo (name, size, type, folder and, on request, image dimensions) and is validated on arrival against size, total size, type, count, duplicate and custom rules; a rejected file stays in the list with its reason. Content is read on demand, as a byte array or a stream. A drop zone panel, thumbnails, type glyphs, remove buttons, templates and screen reader announcements are built in. To send files to a server, use BitFileUpload.

Display & drop zone

Image previews and file icons, translating every built-in string, hiding the built-in file list, and the drop zone panel.

Preview & file icons

ShowPreview shows a thumbnail for each image and a type glyph for everything else. The thumbnail's object URL is exposed as PreviewUrl and revoked for you. FileIconSelector picks the glyph instead; returning null leaves none.

Images and documents together:



A selector of your own:

Localization

Every built-in string has a parameter: Label, Description, RemoveButtonTitle, FileListAriaLabel, the six ...ErrorMessages, FileSizeFormatter and AnnouncementProvider for the screen reader announcement. Set them app-wide with the cascading parameters.


Raw byte counts instead of the built-in humanizer:

HideFileList

HideFileList hides the built-in list while the selection keeps working, for an app that renders its own view of the files from OnFilesChange.


Custom file list:

No files selected yet.

Drop zone

ShowDropZone renders the browse button as a full-width dashed panel with a glyph, still reached with Tab and opened with Enter or Space, and defaults it to Outline. DropZoneIconName swaps the CloudUpload glyph (an empty string removes it); DropZoneIcon takes an external one.

Any file type, as many as you like.

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.