SubComponents
Control
The control subcomponent is required to render the Control
of the FileUploadInput component. Because of this, this component extends the native input
component props. Because of this, you can use all of the native props. This is a required children.
Control API
Notice that there is a difference between using hasError, isDisabled, isReadOnly
here or in the parent component. It is not recommended to change this props in the Control
subcomponent, because this props can be inherited from the Wrapper
. If you use it in the Control
subcomponent, you will get the state only in the field.
fileName
string
❌
defaultFileName
string
❌
hasError
boolean
❌
isDisabled
boolean
❌
isReadOnly
boolean
❌
acceptedFiles
string
❌
explorerAcceptedFiles
'Audio' | 'Images' | 'All' | 'Video' | string;
❌
placeholder
string
❌
onFileClear
(e: FileUploadInputOnFileClearProps) => void;
❌
onChange
(e: FileUploadInputOnChangeProps) => void;
❌
Button
You can add your own custom <FileUploadInput.Button />.
If no Node is provided, only the Input will be rendered. The <FileUploadInput.Button />
should always be a <FileUploadInput.Control>
children. This subcomponent extends the native SDS Button props.
<FileUploadInput.Control>
<FileUploadInput.Button
isLoading={false}
variant='primary'
iconAfter='upload'>
A custom button
</FileUploadInput.Button>
</FileUploadInput.Control>
HelpText
The HelpText subcomponent extends the SDS label component. See for reference: HelpText.
Label
The Label subcomponent extends the SDS label component. See for reference: Label
Last updated