Skip to main content

File Input

The FileInput component is a specialized input that provides a clean interface for selecting files, showing detailed selection information and upload progress. It is meant to be a direct replacement for a standard file input.

info

For more details about Vuetify’s usage of FileInput component, click FileInput page.
For more prop explanations, click Vuetify FileInput API page.

Props

AttributeDescriptionTypeDefault
valueincludes attributes such as the name of the uploaded file, its size, when it was uploaded.object-
acceptprop that gives the file types to be accepted in string(e.g. : 'image/*').string-
appendIconAppends an icon to the component, uses the same syntax as Icon.stringundefined
autoFocusEnables autofocus.booleanfalse
chipsChanges display of selections to chips.booleanfalse
classprop that controls the classes added on the component.string-
clearIconApplied when using clearable and the input is dirty.string'$clear'
clearableAdd input clear functionality, default icon is Material Design Icons mdi-clear.booleantrue
counterCreates counter for input length; if no number is specified, it defaults to 25. Does not apply any validation.boolean | number | stringundefined
counterSizeStringThe text displayed when using the counter and show-size props.string'$vuetify.fileInput.countersize'
darkApplies dark theme.booleanfalse
disabledDisable the input.booleanfalse
errorPuts the input in a manual error state.booleanfalse
errorCountThe total number of errors that should display at once.number | string1
errorMessagesPuts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the rules prop. This field will not trigger validation.string | Array[]
filledApplies the alternate filled input style.booleanfalse
hideDetailsHides hint and validation errors. When set to auto messages will be rendered only if there’s a message (hint, error message, counter value etc) to display.boolean | stringundefined
hideInputDisplay the icon only without the input (file names).booleanfalse
hintDetails text.stringundefined
labelsets input label.stringundefined
loadingDisplays linear progress bar. Can either be a string which specifies which color is applied to the progress bar (any material color or theme color - primary, secondary, success, info, warning, error) or a boolean which uses the component color (set by color prop - if it’s supported by the component) or the primary colorboolean | stringfalse
multipleAdds the multiple attribute to the input, allowing multiple file selections.booleanfalse
outlinedApplies the outlined style to the input.booleanfalse
persistentHintForces hint to always be visible.booleanfalse
placeholdersets the input’s placeholder text.stringundefined
prefixDisplays prefix text.stringundefined
prependIconPrepends an icon to the component, uses the same syntax as Icon.string'$file'
prependInnerIconPrepends an icon inside the component’s input, uses the same syntax as Icon.stringundefined
rulesAccepts a mixed array of types function, boolean and string. Functions pass an input value as an argument and must return either true / false or a string containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) false or is a string.Array[]
shapedRound if outlined and increase border-radius if filled. Must be used with either outlined or filled.booleanfalse
soloChanges the style of the input.booleanfalse
soloInvertedReduces element opacity until focused.booleanfalse
suffixDisplays suffix text.stringundefined
showsizesets the displayed size of selected file(s). When using true will default to 1000 displaying (kB, MB, GB) while 1024 will display (KiB, MiB, GiB).boolean | numberfalse
singleLineLabel does not move on focus.booleanfalse
smallChipsChanges display of selections to chips with the small property.booleanfalse
successPuts the input in a manual success state.booleanfalse
successMessagesPuts the input in a success state and passes through custom success messages.string | Array[]
truncateLengthThe length of a filename before it is truncated with ellipsis.number | string22
typeSets input type.string'file'
validateOnBlurDelays validation until blur event.booleanfalse
tabindexIt determines the order of switching from one component to another with the tab key.stringundefined
visibleVisibility of FileInput component.booleantrue

Events

AttributeDescription
changeEmitted when the input is changed by user interaction File[]
click:mouseEventEmitted when input is clicked
click:prependEmitted when prepended icon is clicked
click:prepend-innerEmitted when prepended inner icon is clicked
click:append-outerEmitted when appended outer icon is clicked
click:appendEmitted when appended icon is clicked
click:clearEmitted when clearable icon clicked
focusEmitted when component is focused

Slots

AttributeDescription
appendAdds an item inside the input and after input content
append-outerAdds an item outside the input and after input content
counter`{ props: { dark: boolean, light: boolean, max: string
defaultThe default Vue slot.
labelReplaces the default label
message{ key: number, // the messages index, message: string, // the message }
prependAdds an item outside the input and before input content
prepend-innerAdds an item inside the input and before input content
progressSlot for custom progress linear (displayed when loading prop is not equal to boolean False)
selectionSlot for defining a custom appearance for selected item(s). Provides the current index, text (truncated) and file.

Samples Qjson

FileInput
FileInput_ImagePicker
FileInputGetUploadedContent
FileInput-Slot-VIcon-Dolu