Skip to content

File Input

@astryxdesign/core v0.7.1 · FileInput

FileInput Props ​

NameTypeDefaultDescription
v-modelFile | File[] | nullnullThe selected file. An array when isMultiple is set.
labelstring—Required accessible name.
acceptstring—HTML accept list, such as .pdf,.docx or image/*.
isMultiplebooleanfalseAllow more than one file.
maxSizenumber—Maximum size of one file, in bytes.
maxFilesnumber—Maximum number of files when isMultiple is set.
mode'input' | 'dropzone''input'Compact field, or a dashed drop target.
placeholderstringChoose fileText shown when nothing is selected. Follows the locale.
size'sm' | 'md' | 'lg''md'Field height. 28, 32, or 36px.
statusFieldStatusInput—Error, warning, or success. A rejected file supplies an error when this is omitted.
statusVariant'attached' | 'detached' | 'tooltip''attached'Where the status message sits.
isDisabledbooleanfalseBlocks the picker and drops.
disabledMessagestring—Explains why the field is disabled. With isDisabled, the message shows in a tooltip on hover or keyboard focus and the trigger stays focusable with aria-disabled; the picker still cannot open.
labelTooltipstring—Hint shown from the info icon at the end of the label.
isRequiredbooleanfalseMarks the field required.
isLoadingbooleanfalseShows a spinner, for an upload in progress.
descriptionstring—Help text under the label.
widthnumber | string—Width of the whole field. Numbers are pixels.
changeAction(files) => void | Promise<void>—Called after a selection and after a clear. A rejection emits actionError. A spinner shows while it is pending.
clearLabelstring—Accessible name of the clear button. It includes the field label by default. The tooltip only says “Clear”.
containerClassstring | object | array—Class for the field container. Has no effect, and warns in development, inside InputGroup and in a horizontal-labels FormLayout.
containerStyleStyleValue—Inline style for the field container.
controlClassstring | object | array—Class for the file field box. A class written on the component lands here too, with no warning.
controlStyleStyleValue—Inline style for the file field box. A style written on the component lands here too.

Events ​

NamePayloadDescription
update:modelValueFile | File[] | nullEmitted when the selection changes.
changeFile | File[] | nullEmitted with the same value, before changeAction.
actionErrorunknown, File | File[] | nullEmitted when changeAction rejects.