File input
File input allows users to attach one or multiple files.
This component requires the following JavaScript plugin:
Example
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxComponent API
Root
-
x-file-inputCustom Alpine directive that marks the File Input Root.
-
data-draggingType:
boolean
Default:falseAttribute used to style File Input Root when a file is dragged over the File Input Dropzone.
-
data-invalidType:
boolean
Default:falseAttribute used to style File Input Root when an invalid file is provided.
Dropzone
-
x-file-input:dropzoneCustom Alpine directive that marks the File Input Dropzone.
-
data-draggingType:
boolean
Default:falseAttribute used to style File Input Root when a file is dragged over the File Input Dropzone.
-
data-invalidType:
boolean
Default:falseAttribute used to style File Input Root when an invalid file is provided.
Input
-
x-file-input:inputCustom Alpine directive that marks the File Input Input.
-
aria-labelDefault:
'Drag file here or choose from folder'Accessibility attribute describing the file input to assistive technology.
-
acceptType:
string | undefined
Default:undefinedNative attribute used to describe the file types accepted by this input.
-
data-minsizeType:
number | undefined
Default:undefinedCustom attribute use to provide the minimum acceptable file size, in bytes.
-
data-maxsizeType:
number | undefined
Default:undefinedCustom attribute use to provide the maximum acceptable file size, in bytes.
-
data-invalidType:
boolean
Default:falseAttribute used to style File Input Root when an invalid file is provided.
-
aria-invalidType:
boolean
Default:falseAccessibility attribute that communicates when a provided file was invalid.
Error Message
-
x-file-input:error-messageCustom Alpine directive that marks the File Input Error Message.