FileInput

February 5, 2026 ยท View on GitHub

File entry field

Usage

import { FileInput } from "@docspace/ui-kit/components/file-input";
<FileInput
  placeholder="Input file"
  accept={[".doc", ".docx"]}
  onInput={(file) => {
    console.log(
      file,
      `name: ${file.name}`,
      `lastModified: ${file.lastModifiedDate}`,
      `size: ${file.size}`,
    );
  }}
/>

Properties

PropsTypeRequiredValuesDefaultDescription
acceptstring[]--[""]Specifies files visible for upload
buttonLabelstring---Specifies the label for the upload button
classNamestring---Accepts class
data-test-idstring---Data attributes for testing
hasErrorbool--falseIndicates the input field has an error
hasWarningbool--falseIndicates the input field has a warning
idstring---Used as HTML id property
idButtonstring---ID for the button element
isDisabledbool--falseIndicates that the field cannot be used (e.g not authorised, or changes not saved)
isDocumentIconbool--falseIndicates that icon is document. Otherwise, it is folder icon
isMultiplebool--trueIndicates that the input may contain multiple files
isLoadingbool--falseTells when the button should show loader icon
namestring---Used as HTML name property
onInputfunc---Called when a file is selected (File or File[])
placeholderstring---Placeholder text for the input
scalebool--falseIndicates the input field has scale
sizestring-base, middle, big, huge, largebaseSupported size of the input fields.
styleobj, array---Accepts css style