Skip to content

VFilePicker

Props

NameTypeDescription
acceptstringDefines a list of allowed file extensions or MIME types
disabledbooleanSets the element's disabled state. A disabled element will not be included during form submission.
error-textstringProvides a custom error message. Any current error state will be overridden.
file-too-big-errorstringCustom error message shown when a file exceeds the maximum file size
helper-textstringProvides additional information to help the user enter the correct information. To add HTML to the helper text, use the helper-text slot instead.
initial-valuestringThe default value of the element. This value sets the value property only when the value property has not been explicitly set.
invalid-file-type-errorstringCustom error message shown when a file does not match the accepted types
labelstringThe label for the form element.
max-file-sizenumberMaximum allowed file size per file
max-filesnumberLimits how many files can be selected; additional files will be rejected
max-files-exceeded-errorstringCustom error message shown when more than the allowed number of files are selected
namestringThe name of the element. This element's value will be surfaced during form submission under the provided name.
requiredbooleanRequire the field to be completed prior to form submission.
single-filebooleanAllows only a single file; subsequent uploads replace the current file
sizeEnum:
normal
expanded
Sets the display size of the input element
valuestringThe current value of the element.

Events

NameEvent TypeDescription
blurFocusEventFires when the element loses focus.
changeCustomEvent<undefined>Emitted when files are added or removed.
clickMouseEventFires when a pointing device button (such as a mouse's primary mouse button) is both pressed and released while the pointer is located inside the element.
focusFocusEventFires when the element receives focus.
inputEventFires when the value of an element has been changed.
keydownKeyboardEventFires when a key is pressed.
keyupKeyboardEventFires when a key is released.

Slots

NameDescription
contextual-helpSlot for the contextual-help component, displayed next to the label.
helper-textDescribes how to use the file-picker. Alternative to the helper-text attribute.

Methods

NameTypeDescription
checkValidity() => booleanReturn the current validity of the element.
removeAllFiles() => voidRemoves all files from the File Picker.
reportValidity() => booleanReturn the current validity of the element. If false, fires an invalid event at the element.