Usage
FileInput
component supports Input and Input.Wrapper components features and all input
element props. FileInput
documentation does not include all features supported by the component – see Input documentation to learn about all available features.
Input description
Controlled
When multiple
is false
:
When multiple
is true
:
Multiple
Set multiple
to allow user to pick more than one file:
Accept
Set accept
prop to restrict files selection to specific mime types:
Custom value component
Error state
Invalid name
Disabled state
Styles API
FileInput
supports Styles API, you can add styles to any inner element of the component withclassNames
prop. Follow Styles API documentation to learn more.
Description
Error
Component Styles API
Hover over selectors to highlight corresponding elements
Get element ref
Accessibility
If FileInput
is used without label
prop, it will not be announced properly by screen reader:
Set aria-label
to make the input accessible. In this case label will not be visible, but screen reader will announce it:
If label
prop is set, input will be accessible it is not required to set aria-label
: