DocSpace-client/packages/shared/components/file-input
2024-03-25 12:49:54 +03:00
..
FileInput.stories.tsx Shared: fix ts problems 2024-03-22 10:20:39 +03:00
FileInput.styled.ts Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
FileInput.test.tsx Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
FileInput.tsx Shared: FileInput: Fixed clicking on the icon if it is disabled. 2024-03-25 12:49:54 +03:00
FileInput.types.ts Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
index.tsx Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
README.md Client: fix wrong import - export for shared components 2024-01-10 11:01:43 +03:00

FileInput

File entry field

Usage

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