File input Example

Select a fileX

How to use this input

Props

NameTypeDefaultDescription
texts{txtDragActive?: string,txtDragUnactive?: string,txtFileOk: string} *(if txtFileOk is not null, considered the file choosen) *{txtDragActive: 'Drop the file here', txtDragUnactive: 'Select a file'}Displayed string, if set in parent, can use translation.
handleFileChange(files) => void)-Triggered function when the choosen file changes.
refMutableRefObject-File reference.
acceptOn type file-Hint for expected file type in file upload controls.
autocapitalizeOn type all except url, email and password-Controls automatic capitalization in inputted text.
autocompleteOn type all except checkbox, radio and buttons-Hint for form autofill feature.
captureOn type file-Media capture input method in file upload controls.
disabledOn type all-Whether the user can interract with the input or not.
formOn type all-Associates the control with a form element.
listOn type all except hidden, password, checkbox, radio and buttons-Value of the id attribute of the datalist of autocomplete options.
multipleBoolean, On type email, file-Whether to allow multiple values.
nameOn type all-Name of the form control. Submitted with the form as part of a name/value pair.
readonlyBoolean, On type all except hidden, range, color, checkbox, radio, and buttons-The value is not editable.
requiredBoolean, On type all except hidden, range, color, and buttons-A value is required or must be checked for the form to be submittable.
valueOn type all except image-The value of the control. When specified in the HTML, corresponds to the initial value.

Playground

Import from filigran-ui :

Import {FileInput} from 'filigran-ui'


            <FileInput
texts={{
          txtDragActive: 'Drop the file HERE!',
          txtDragUnactive: 'Select a FILE',
          txtFileOk: null,
        }}
/>