@ui5/webcomponents-react
Version:
React Wrapper for UI5 Web Components and additional components
22 lines (21 loc) • 1.22 kB
JavaScript
'use client';
import { withWebComponent } from '../../internal/withWebComponent.js';
/**
* The `FileUploader` opens a file explorer dialog and enables users to upload files.
* The component consists of input field, but you can provide an HTML element by your choice
* to trigger the file upload, by using the default slot.
* Furthermore, you can set the property "hideInput" to "true" to hide the input field.
*
* To get all selected files, you can simply use the read-only "files" property.
* To restrict the types of files the user can select, you can use the "accept" property.
*
* And, similar to all input based components, the FileUploader supports "valueState", "placeholder", "name", and "disabled" properties.
*
* For the `FileUploader`
*
*
* __Note__: This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/)
*/
const FileUploader = withWebComponent('ui5-file-uploader', ['accept', 'maxFileSize', 'name', 'placeholder', 'value', 'valueState'], ['disabled', 'hideInput', 'multiple'], ['valueStateMessage'], ['change', 'file-size-exceed']);
FileUploader.displayName = 'FileUploader';
export { FileUploader };