Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
    • Checkbox
    • ChoiceGroup
    • CurrencyInput
    • DateInput
    • FileInputZone
    • Filters
    • Form
    • MaskedTextInput
    • PasswordInput
    • Pill
    • Pill
    • Radio
    • SearchInput
    • SegmentedSlider
    • Select
    • Switch
    • TextArea
    • TextInput
  • Layout & containers
  • Overlays
  • Feedback & status
  • Data display
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
  • Forms & inputs
  • FileInputZone

FileInputZone

Lets a member upload a file, by dropping it or browsing. Wraps a native file input, and its text can be localised.

Health
Component health
Source
View on Github
Design
View Figma
Playground
No Example
Accessibility
unknown
Platform
Web
  • Overview
  • Props
  • Figma

Basic Usage​

Drag and drop your file

or

Multiple files​

Drag and drop your files

or

Customized locales​

You can pass a locales object to customize the text displayed in the component.

Drag and drop only one file

or you click on the button below

Caveats​

This component is using HTML <input type="file"/>. To seed it with an existing list of files (e.g. state kept alive across a remount), pass initialFiles — it is only used once, at mount.

FileInputZone props

NameTypeDefault ValueDescriptionUsage count
allowMultipleFilesbooleanundefinedfalseAllow the user to upload multiple files
disabledbooleanundefinedDisable the component
dropzoneOptionsDropzoneOptionsundefinedDropzone options see available options on https://react-dropzone.js.org/#src
errorMessagestringundefinedShow the error message
fullModebooleanundefinedfalseMake the component take full height available
initialFilesFile[]undefinedSeeds the internal files list once, on mount. Use this to keep the list in sync with a file list owned outside this component (e.g. state that outlives a remount)
isLoadingbooleanundefinedfalseReplaces the label and accepted formats with a loader, keeping their height so the layout doesn't shift
keepFilesInLocalStorageWithIdstringfalseundefinedfalseIf files should be persisted between refreshes or rerender of component, please provide an ID to this component that can be used to fetch past files
locales
11 possibilities{ filesListTitle?: stringundefined; label?: { singular?: stringundefined; plural?: stringundefined; }undefined; acceptedFormats?: stringundefined; or?: stringundefined; buttonLabel?: { singular?: stringundefined; plural?: stringundefined; }undefined; }undefined
{}Customize the text displayed
onChange((files: File[]) => void)undefinedHandler called when files list have been updated
showFileListbooleanundefinedtrue
showFilesPreviewbooleanundefinedtrueShow the files preview in the files list
Edit this page
Previous
DateInput
Next
Filters
  • Basic Usage
  • Multiple files
  • Customized locales
  • Caveats