Client component

File Upload

File picking and drag-and-drop built around a hidden native <input type="file">: the picker dialog, accept filtering and mobile integrations stay the platform's. maxSize/maxFiles violations are rejected and reported via onReject, never silently truncated.

Drag files here or click to browse

Import#

import { FileUpload } from "astralis-ui";

Button trigger#

Skip the dropzone entirely: FileUpload.Trigger wraps any element and opens the picker:

Props#

PropTypeDefaultDescription
acceptstringNoneNative accept filter, such as "image/*,.pdf". The picker enforces it.
multiplebooleanfalseAllow more than one file.
maxFilesnumberNoneCap on the number of kept files when multiple is set. Picks past it are rejected.
maxSizenumberNonePer-file size cap in bytes. Larger picks are rejected.
onFilesChange(files: File[]) => voidNoneThe full kept list after every add or remove.
onReject(rejections: { file, reason: "size" | "count" }[]) => voidNoneThe picks that were refused, and why.
disabledbooleanfalseLocks picking and dropping.

Parts#

PropTypeDefaultDescription
FileUpload.Dropzonediv propsNoneDrop target that also opens the picker on click, Enter or Space.
FileUpload.Triggerchildren: ReactElementNoneWraps your own element, such as a Button, to open the picker.
FileUpload.ItemGroupul propsNoneThe kept files, each with its name, size and a remove button.

Keyboard#

KeyAction
TabMove to the dropzone, then to each file's remove button
Enter / Space on the dropzoneOpen the file picker
Enter / Space on a remove buttonRemove that file

Dragging files is pointer-only; the picker is the keyboard path to the same result.