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-input
Custom Alpine directive that marks the File Input Root.
-
data-dragging
Type:
boolean
Default:false
Attribute used to style File Input Root when a file is dragged over the File Input Dropzone.
-
data-invalid
Type:
boolean
Default:false
Attribute used to style File Input Root when an invalid file is provided.
Dropzone
-
x-file-input:dropzone
Custom Alpine directive that marks the File Input Dropzone.
-
data-dragging
Type:
boolean
Default:false
Attribute used to style File Input Root when a file is dragged over the File Input Dropzone.
-
data-invalid
Type:
boolean
Default:false
Attribute used to style File Input Root when an invalid file is provided.
Input
-
x-file-input:input
Custom Alpine directive that marks the File Input Input.
-
aria-label
Default:
'Drag file here or choose from folder'
Accessibility attribute describing the file input to assistive technology.
-
accept
Type:
string | undefined
Default:undefined
Native attribute used to describe the file types accepted by this input.
-
data-minsize
Type:
number | undefined
Default:undefined
Custom attribute use to provide the minimum acceptable file size, in bytes.
-
data-maxsize
Type:
number | undefined
Default:undefined
Custom attribute use to provide the maximum acceptable file size, in bytes.
-
data-invalid
Type:
boolean
Default:false
Attribute used to style File Input Root when an invalid file is provided.
-
aria-invalid
Type:
boolean
Default:false
Accessibility attribute that communicates when a provided file was invalid.
Error Message
-
x-file-input:error-message
Custom Alpine directive that marks the File Input Error Message.