LLabanaat

FileUpload

Drag-and-drop zone with an always-present "browse" button, so drag-and-drop is never the only way to select a file. Fully controlled: the component reports changes via onFilesChange rather than owning selection state itself.

function Demo() {
const [files, setFiles] = useState([]);
return (
  <FileUpload
    label="Attachments"
    files={files}
    onFilesChange={setFiles}
    multiple
    maxSizeBytes={5 * 1024 * 1024}
  />
);
}
render(<Demo />);

Editable — change the code above and the preview updates live.

Installation

import { FileUpload } from "@labanaat/ui/file-upload";

Props

PropTypeDefaultDescription
filesFile[]Controlled list of selected files
onFilesChange(files: File[]) => voidCalled whenever the selection changes
labelstringField label
acceptstringNative file-input accept filter
multiplebooleanfalseAllow selecting more than one file
maxSizeBytesnumberFiles over this size are silently rejected
disabledbooleanfalseDisables interaction