UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

22 lines (21 loc) 1.36 kB
'use client'; import { withWebComponent } from '@ui5/webcomponents-react-base'; /** * 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! [FileUploader UI5 Web Component Documentation](https://ui5.github.io/webcomponents/components/FileUploader) | [Repository](https://github.com/UI5/webcomponents) */ const FileUploader = withWebComponent('ui5-file-uploader', ['accept', 'accessibleDescription', 'accessibleDescriptionRef', 'accessibleName', 'accessibleNameRef', 'maxFileSize', 'name', 'placeholder', 'value', 'valueState'], ['disabled', 'hideInput', 'multiple', 'required'], ['valueStateMessage'], ['change', 'file-size-exceed']); FileUploader.displayName = 'FileUploader'; export { FileUploader };