DocSpace-client/packages/components/file-input
Aleksandr Lushkin 28b8bc346e Merge branch 'develop' into feature/rtl-interface-direction
# Conflicts:
#	.gitignore
#	packages/common/store/SettingsStore.js
#	packages/components/file-input/styled-file-input.js
#	packages/components/modal-dialog/styled-modal-dialog.js
#	yarn.lock
2023-07-25 14:01:29 +02:00
..
file-input.stories.js Web: Moved all clients app to packages directory 2022-07-22 22:01:25 +03:00
file-input.test.js Web: Moved all clients app to packages directory 2022-07-22 22:01:25 +03:00
index.js Merge branch 'master' into develop 2023-07-18 19:26:32 +03:00
README.md Web: Moved all clients app to packages directory 2022-07-22 22:01:25 +03:00
styled-file-input.js Merge branch 'develop' into feature/rtl-interface-direction 2023-07-25 14:01:29 +02:00

FileInput

File entry field

Usage

import FileInput from "@docspace/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

Props Type Required Values Default Description
className string - - - Accepts class
hasError bool - - false Indicates the input field has an error
hasWarning bool - - false Indicates the input field has a warning
id string - - - Used as HTML id property
isDisabled bool - - false Indicates that the field cannot be used (e.g not authorised, or changes not saved)
name string - - - Used as HTML name property
onInput func - - - Called when a file is selected
placeholder string - - - Placeholder text for the input
scale bool - - false Indicates the input field has scale
size string - base, middle, big, huge, large base Supported size of the input fields.
style obj, array - - - Accepts css style
accept string - - - Specifies files visible for upload