File Uploader

Creates a dropzone for file uploads.

Accessibility

  • "Browse files" has aria-controls="fileupload" set.

When to use

  • Enable file(s) upload through drag and drop or the system Browse files dialog.

File uploader basic usage

Drop files here to upload
or

File upload with error

Drop files here to upload
or

File upload with unknown progress

Drop files here to upload
or

File uploader in disabled state

Drop files here to upload
or

File uploader with overrides

Drop files here to upload
or

Overrides

Additionally, you can fully customize any part of the File Uploader through the overrides prop. The File Uploader consists of multiple subcomponents that are listed bellow and you can override each one of them. To help you identify the names of these subcomponents, you can highlight them through this selector:

Drop files here to upload
or
Something went wrong. Sorry!

Note: You should always use longhand CSS properties. Mixing shorthands and longhands will lead into strange behaviors!

File Uploader API

accept union

react-dropzone: https://github.com/react-dropzone/react-dropzone/blob/master/typings/react-dropzone.d.ts

One of
string,
Array
string

disableClick boolean = true

Disallow clicking on the dropzone container to open file dialog

disabled boolean

getDataTransferItems function

One of
SyntheticDragEventHTMLElement,
SyntheticInputEventHTMLInputElement,
SyntheticDragEvent*,
SyntheticEvent*
=> PromiseArrayOne of
File,
DataTransferItem

maxSize number

minSize number

multiple boolean

name string

onClick function

SyntheticMouseEventHTMLElement => mixed

onFocus function

SyntheticFocusEventHTMLElement => mixed

onBlur function

SyntheticFocusEventHTMLElement => mixed

onKeyDown function

SyntheticKeyboardEventHTMLElement => mixed

onDragStart function

SyntheticDragEventHTMLElement => mixed

onDragEnter function

SyntheticDragEventHTMLElement => mixed

onDragOver function

SyntheticDragEventHTMLElement => mixed

onDragLeave function

SyntheticDragEventHTMLElement => mixed

onDrop function

function
Array
,
Array
,
SyntheticDragEventHTMLElement
=> mixed

onDropAccepted function

function
Array
,
SyntheticDragEventHTMLElement
=> mixed

onDropRejected function

function
Array
,
SyntheticDragEventHTMLElement
=> mixed

onFileDialogCancel function

() => mixed

preventDropOnDocument boolean

errorMessage string

baseui

onCancel function

() => mixed

onRetry function

() => mixed

overrides { Root: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>>, FileDragAndDrop: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>>, ContentMessage: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>>, ContentSeparator: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>>, HiddenInput: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>>, ProgressMessage: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>>, ErrorMessage: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>> }<object> = {}

{ Root: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>>, FileDragAndDrop: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>>, ContentMessage: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>>, ContentSeparator: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>>, HiddenInput: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>>, ProgressMessage: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>>, ErrorMessage: { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>><<T>> }
$afterFileDrop boolean required
$isDisabled boolean required
$isDragActive boolean required
$isDragAccept boolean required
$isDragReject boolean required
$isFocused boolean required
$theme required
breakpoints required
small number required
medium number required
large number required
colors required
primary50 string required
primary100 string required
primary200 string required
primary300 string required
primary400 string required
primary string required
primary500 string required
primary600 string required
primary700 string required
negative50 string required
negative100 string required
negative200 string required
negative300 string required
negative400 string required
negative string required
negative500 string required
negative600 string required
negative700 string required
warning50 string required
warning100 string required
warning200 string required
warning300 string required
warning400 string required
warning string required
warning500 string required
warning600 string required
warning700 string required
positive50 string required
positive100 string required
positive200 string required
positive300 string required
positive400 string required
positive string required
positive500 string required
positive600 string required
positive700 string required
white string required
mono100 string required
mono200 string required
mono300 string required
mono400 string required
mono500 string required
mono600 string required
mono700 string required
mono800 string required
mono900 string required
mono1000 string required
black string required
rating200 string required
rating400 string required
background string required
backgroundAlt string required
backgroundInv string required
foreground string required
foregroundAlt string required
foregroundInv string required
border string required
borderAlt string required
borderFocus string required
borderError string required
buttonPrimaryFill string required
buttonPrimaryText string required
buttonPrimaryHover string required
buttonPrimaryActive string required
buttonSecondaryFill string required
buttonSecondaryText string required
buttonSecondaryHover string required
buttonSecondaryActive string required
buttonTertiaryFill string required
buttonTertiaryText string required
buttonTertiaryHover string required
buttonTertiaryActive string required
buttonTertiarySelectedText string required
buttonTertiarySelectedFill string required
buttonMinimalFill string required
buttonMinimalText string required
buttonMinimalHover string required
buttonMinimalActive string required
buttonDisabledFill string required
buttonDisabledText string required
breadcrumbsText string required
breadcrumbsSeparatorFill string required
fileUploaderBackgroundColor string required
fileUploaderBackgroundColorActive string required
fileUploaderBorderColorActive string required
fileUploaderBorderColorDefault string required
fileUploaderMessageColor string required
linkText string required
linkVisited string required
linkHover string required
listHeaderFill string required
listBodyFill string required
listIconFill string required
listBorder string required
tickFill string required
tickFillHover string required
tickFillActive string required
tickFillSelected string required
tickFillSelectedHover string required
tickFillSelectedHoverActive string required
tickFillDisabled string required
tickBorder string required
tickMarkFill string required
sliderTrackFill string required
sliderTrackFillHover string required
sliderTrackFillActive string required
sliderTrackFillSelected string required
sliderTrackFillSelectedHover string required
sliderTrackFillSelectedActive string required
sliderTrackFillDisabled string required
sliderHandleFill string required
sliderHandleFillHover string required
sliderHandleFillActive string required
sliderHandleFillSelected string required
sliderHandleFillSelectedHover string required
sliderHandleFillSelectedActive string required
sliderHandleFillDisabled string required
sliderBorder string required
sliderBorderHover string required
sliderBorderDisabled string required
inputFill string required
inputFillError string required
inputFillDisabled string required
inputTextDisabled string required
notificationPrimaryBackground string required
notificationPrimaryText string required
notificationPositiveBackground string required
notificationPositiveText string required
notificationWarningBackground string required
notificationWarningText string required
notificationNegativeBackground string required
notificationNegativeText string required
menuFillHover string required
menuFontDefault string required
menuFontDisabled string required
menuFontHighlighted string required
menuFontSelected string required
shadowFocus string required
shadowError string required
tagBackground string required
tagNeutralBackground string required
tagPrimaryBackground string required
tagPositiveBackground string required
tagWarningBackground string required
tagNegativeBackground string required
tagRGBGradient string required
tagRGBGradientSecondary string required
tableHeadBackgroundColor string required
toastText string required
toastPrimaryBackground string required
toastPositiveBackground string required
toastWarningBackground string required
toastNegativeBackground string required
typography required
font100 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
font200 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
font250 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
font300 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
font350 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
font400 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
font450 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
font500 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
font600 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
font700 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
font800 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
font900 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
font1000 required
fontFamily string required
fontWeight union required One of
string,
number
fontSize string required
lineHeight union required One of
string,
number
sizing required
scale0 string required
scale100 string required
scale200 string required
scale300 string required
scale400 string required
scale500 string required
scale600 string required
scale700 string required
scale800 string required
scale900 string required
scale1000 string required
scale1200 string required
scale1400 string required
scale1600 string required
scale2400 string required
scale3200 string required
scale4800 string required
lighting required
shadow400 string required
shadow500 string required
shadow600 string required
shadow700 string required
overlay0 string required
overlay100 string required
overlay200 string required
overlay300 string required
overlay400 string required
overlay500 string required
overlay600 string required
animation required
timing100 string required
timing400 string required
timing700 string required
easeOutCurve string required
easeInCurve string required
easeInOutCurve string required
borders required
border100 required
borderColor string required
borderStyle string required
borderWidth string required
border200 required
borderColor string required
borderStyle string required
borderWidth string required
border300 required
borderColor string required
borderStyle string required
borderWidth string required
border400 required
borderColor string required
borderStyle string required
borderWidth string required
border500 required
borderColor string required
borderStyle string required
borderWidth string required
border600 required
borderColor string required
borderStyle string required
borderWidth string required
useRoundedCorners boolean required
radius100 string required
radius200 string required
radius300 string required
zIndex required
modal number required

progressAmount number

progressMessage string