BlogPlaygroundOne

VFileInput API


Props
name
type
default
boolean
false

Controls the active state of the item. This is typically used to highlight the component.

  | string
  | (string | [string, number])[]
  | (new () => any)
  | FunctionalComponent
undefined

Creates a v-icon component after default content in the append slot.

  | string
  | (string | [string, number])[]
  | (new () => any)
  | FunctionalComponent
undefined

Creates a v-icon component in the append-inner slot.

string
undefined

Sets the color of the input when it is not focused.

string
undefined

Applies specified color to the control’s background. Used on components that also support the color prop. - supports utility colors with or without bg- prefix (for example success, purple or bg-purple) or CSS color (#033 or rgba(255, 0, 0, 0.5)). Find a list of built-in classes on the colors page.

boolean
undefined

Vertically align appendInner, prependInner, clearIcon and label in the center.

boolean
false

Changes display of selections to chips.

boolean
true

Allows for the component to be cleared.

  | string
  | (string | [string, number])[]
  | (new () => any)
  | FunctionalComponent
'$clear'

The icon used when the clearable prop is set to true.

string
undefined

Applies specified color to the control - supports utility colors with or without text- prefix (for example success, purple or text-purple) or CSS color (#033 or rgba(255, 0, 0, 0.5)). Find a list of built-in classes on the colors page.

boolean
false

Displays the number of selected files.

string
'$vuetify.fileInput.counterSize'

The text displayed when using the counter and show-size props. Can also be customized globally on the internationalization page.

string
'$vuetify.fileInput.counter'

The text displayed when using the counter prop. Can also be customized globally on the internationalization page.

'default' | 'comfortable' | 'compact'
'default'

Adjusts the vertical height used by the component.

boolean
false

Manually apply the dirty state styling.

boolean
null

Removes the ability to click or target the input.

boolean
false

Puts the input in a manual error state.

string | string[]
[]

Puts 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
undefined

Make the input accept only files matched by one or more unique file type specifiers. Applies to drag & drop and selecting folders. Emits rejected event when some files do not pass through to make it possible to notify user and deliver better user experience.

boolean
false

Removes box shadow when using a variant with elevation.

boolean
false

Forces a focused state styling on the component.

boolean
false

Makes prepend/append icons full opacity when the field is focused and apply color.

boolean | 'auto'
false

Hides 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
false

Display the icon only without the input (file names).

boolean
false

Hides spin buttons on the input when type is set to number.

string
undefined

Displays hint text below the input when focused. Force this always open with the persistent-hint property.

string | boolean
false

Sets the color of the prepend/append icons.

string
undefined

Sets the DOM id on the component.

boolean
null

Adds / removes inline padding in inputs details. Useful when trying to align different variants of fields and selection controls.

string
undefined

Sets the text of the v-label or v-field-label component.

string | boolean
false

Displays 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 color.

string | number
1

Control the maximum number of shown errors from validation.

string | number
undefined

Sets the maximum width for the component.

string | string[]
[]

Displays a list of messages or a single message if using a string.

string | number
undefined

Sets the minimum width for the component.

File | File[]
null

The v-model value of the component. If component supports the multiple prop, this defaults to an empty array.

boolean
false

Adds the multiple attribute to the input, allowing multiple file selections.

string
undefined

Sets the component’s name attribute.

boolean
false

Always show the clearable icon when the input is dirty (By default it only shows on hover).

boolean
false

Forces hint to always be visible.

  | string
  | (string | [string, number])[]
  | (new () => any)
  | FunctionalComponent
'$file'

Prepends an icon to the component, uses the same syntax as v-icon.

  | string
  | (string | [string, number])[]
  | (new () => any)
  | FunctionalComponent
undefined

Creates a v-icon component in the prepend-inner slot.

boolean
null

Puts input in readonly state.

boolean
false

Reverses the orientation.

string | number | boolean
undefined

Designates the border-radius applied to the component. This can be 0, xs, sm, true, lg, xl, pill, circle, and shaped. Find more information on available border radius classes on the Border Radius page.

(
  | string
  | boolean
  | PromiseLike<ValidationResult>
  | ((value: any) => string | false | true)
  | ((value: any) => PromiseLike<ValidationResult>)
  | [string, any, string]
)[]
[]

Accepts 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.

boolean | 1000 | 1024
false

Sets 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
false

Label does not move on focus/dirty.

string
undefined

Specify a theme for this component and all of its children.

boolean
false

Removes any applied border-radius from the component.

string | number
22

The length of a filename before it is truncated with ellipsis.

  | 'eager'
  | 'lazy'
  | 'blur'
  | 'input'
  | 'submit'
  | 'invalid-input'
  | 'blur lazy'
  | 'input lazy'
  | 'submit lazy'
  | 'invalid-input lazy'
  | 'blur eager'
  | 'input eager'
  | 'submit eager'
  | 'invalid-input eager'
  | 'lazy blur'
  | 'lazy input'
  | 'lazy submit'
  | 'lazy invalid-input'
  | 'eager blur'
  | 'eager input'
  | 'eager submit'
  | 'eager invalid-input'
undefined

Change what type of event triggers validation to run.

any
undefined

The value used when applying validation rules.

  | 'outlined'
  | 'plain'
  | 'filled'
  | 'underlined'
  | 'solo'
  | 'solo-inverted'
  | 'solo-filled'
'filled'

Applies a distinct style to the component.

string | number
undefined

Sets the width for the component.

Events
name
type
[MouseEvent]

Emitted when appended icon is clicked.

[MouseEvent]

Emitted when appended inner icon is clicked.

[MouseEvent]

Emitted when clearable icon clicked.

[MouseEvent]

MISSING DESCRIPTION (edit in github)

[MouseEvent]

Emitted when prepended icon is clicked.

[MouseEvent]

Emitted when prepended inner icon is clicked.

[MouseEvent]

Event that is emitted when using mousedown on the main control area.

[File[]]

Emitted when some of the files from user input, drop or folder selection did not pass through strict-accept filter.

[boolean]

Emitted when the input is focused or blurred

[File | File[]]

Event that is emitted when the component’s model changes.

Slots
{ id: ComputedRef<string> messagesId: ComputedRef<string | undefined> isDirty: ComputedRef<boolean> isDisabled: ComputedRef<boolean> isReadonly: ComputedRef<boolean> isPristine: Ref<boolean, boolean> isValid: ComputedRef<boolean | null> isValidating: Ref<boolean, boolean> hasDetails: Ref<boolean, boolean> reset: () => void resetValidation: () => void validate: () => void }
{ isActive: Ref<boolean, boolean> isFocused: Ref<boolean, boolean> iconColor: ComputedRef<string | undefined> controlRef: Ref<HTMLElement | undefined, HTMLElement | undefined> focus: () => void blur: () => void }
{ isActive: Ref<boolean, boolean> isFocused: Ref<boolean, boolean> iconColor: ComputedRef<string | undefined> controlRef: Ref<HTMLElement | undefined, HTMLElement | undefined> focus: () => void blur: () => void } & { props: Record<string, any> }
never
{ id: ComputedRef<string> messagesId: ComputedRef<string | undefined> isDirty: ComputedRef<boolean> isDisabled: ComputedRef<boolean> isReadonly: ComputedRef<boolean> isPristine: Ref<boolean, boolean> isValid: ComputedRef<boolean | null> isValidating: Ref<boolean, boolean> hasDetails: Ref<boolean, boolean> reset: () => void resetValidation: () => void validate: () => void } & { props: Record<string, unknown> & { class: any } isActive: Ref<boolean, boolean> isFocused: Ref<boolean, boolean> iconColor: ComputedRef<string | undefined> controlRef: Ref<HTMLElement | undefined, HTMLElement | undefined> focus: () => void blur: () => void }
{ id: ComputedRef<string> messagesId: ComputedRef<string | undefined> isDirty: ComputedRef<boolean> isDisabled: ComputedRef<boolean> isReadonly: ComputedRef<boolean> isPristine: Ref<boolean, boolean> isValid: ComputedRef<boolean | null> isValidating: Ref<boolean, boolean> hasDetails: Ref<boolean, boolean> reset: () => void resetValidation: () => void validate: () => void }
{ isActive: Ref<boolean, boolean> isFocused: Ref<boolean, boolean> iconColor: ComputedRef<string | undefined> controlRef: Ref<HTMLElement | undefined, HTMLElement | undefined> focus: () => void blur: () => void } & { label: string; props: Record<string, any> }
{ color: string; isActive: boolean }
{ message: string }
{ id: ComputedRef<string> messagesId: ComputedRef<string | undefined> isDirty: ComputedRef<boolean> isDisabled: ComputedRef<boolean> isReadonly: ComputedRef<boolean> isPristine: Ref<boolean, boolean> isValid: ComputedRef<boolean | null> isValidating: Ref<boolean, boolean> hasDetails: Ref<boolean, boolean> reset: () => void resetValidation: () => void validate: () => void }
{ isActive: Ref<boolean, boolean> isFocused: Ref<boolean, boolean> iconColor: ComputedRef<string | undefined> controlRef: Ref<HTMLElement | undefined, HTMLElement | undefined> focus: () => void blur: () => void }
{ fileNames: string[] totalBytes: number totalBytesReadable: string }

Adds an item inside the input and after input content.

Slot that is appended to the input.

Slot for custom clear icon (displayed when the clearable prop is equal to true).

Slot for the input’s counter text.

The default Vue slot.

Slot for custom input details to modifying the display of messages.

The default slot of the v-label or v-field-label component.

Slot for custom loader (displayed when loading prop is equal to true).

Slot used to customize the message content.

Adds an item outside the input and before input content.

Slot that is prepended to the input.

Slot for defining a custom appearance for selected item(s). Provides the current index, text (truncated) and file.

Exposed
HTMLElement
string[]
string
boolean
() => Promise<void>
() => Promise<void>
(silent: boolean) => Promise<string[]>

Reference to the control element of the field.

An array of error messages that were set by the setErrors method.

The color of the icon.

Boolean indicating if the input is valid.

Resets the input value.

Resets validation of the input without modifying its value.

Validates the input’s value.

SASS Variables