File input
Displays a file input.
Fileinput by drag and drop, single file
<!-- form.blade.php -->
<form class="c-form u-padding__y--4 js-form-validation" id="id_69f073686df90" data-uid="69f073686df9b" method="POST" action="#">
<!-- fileinput.blade.php -->
<div class="c-field c-fileinput is-empty" data-js-file="dropzone" data-js-file-max="1" data-js-file-min="0" data-js-file-is-multi="0" id="id_69f073686d834" data-uid="69f073686d859">
<template class="c-element" data-js-file="notice-template" data-js-upload-error-message="Following files could not be uploaded" data-js-upload-error-message-min-files="Please upload more files" data-uid="69f073686db23">
<!-- notice.blade.php -->
<div class="c-notice c-notice--danger" id="id_69f073686d8ee" data-uid="69f073686d8fe" aria-labelledby="notice__text__id_69f073686d8ee">
<span class="c-notice__icon">
<!-- icon.blade.php -->
<span class="c-icon c-icon--error c-icon--material c-icon--material-error material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-lg" data-material-symbol="error" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" aria-hidden="false" data-uid="69f073686da83">
</span>
</span>
<span id="notice__text__id_69f073686d8ee" data-js-notice-message="true" class="c-notice__message">
<!-- Message -->
</span>
</div>
</template>
<label class="c-element c-field__label c-fileinput__label" for="input_id_69f073686d834" id="label_id_69f073686d834" data-js-file="label" data-uid="69f073686db67">
Choose files
</label>
<!-- Actual input -->
<input type="file"
class="c-fileinput__input"
name="files"
id="input_id_69f073686d834"
accept="audio/*,video/*,image/*"
data-js-file="input"
aria-hidden="true"
tabindex="-1"
>
<div class="c-fileinput__inner c-fileinput__inner--area">
<div class="c-fileinput__area" data-js-file="area">
<!-- typography.blade.php original: p -->
<p class="c-typography c-field__description c-fileinput__description u-margin__top--1 u-margin__bottom--3 c-typography__variant--meta" data-uid="69f073686dc09">
Display as a file input area (dropzone, single file).
</p>
<!-- This button is used to trigger the file input -->
<button class="c-button c-fileinput__button js-file-input-button c-button__basic c-button__basic--default c-button--md" data-js-file="button" aria-live="polite" type="button" aria-label="Select file" data-uid="69f073686dc7f">
<span class="c-button__label"> <span class="c-button__loader"></span>
<span class="c-button__label-icon ">
<!-- icon.blade.php -->
<span class="c-icon c-icon--file-upload c-icon--material c-icon--material-file_upload material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-md" aria-hidden="false" data-material-symbol="file_upload" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" data-uid="69f073686dcc7">
</span>
</span>
<span class="c-button__label-text ">
Select file
</span>
</span> </button>
<!-- This button is used to illustrate drag and drop, it has no function -->
<button class="c-button js-file-input-drop c-button__basic c-button__basic--default c-button--md" data-js-file="drop" aria-hidden="true" type="button" aria-label="Drop files here" data-uid="69f073686dd1a">
<span class="c-button__label"> <span class="c-button__loader"></span>
<span class="c-button__label-icon ">
<!-- icon.blade.php -->
<span class="c-icon c-icon--place-item c-icon--material c-icon--material-place_item material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-md" aria-hidden="false" data-material-symbol="place_item" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" data-uid="69f073686dd5a">
</span>
</span>
<span class="c-button__label-text ">
Drop files here
</span>
</span> </button>
<div class="c-fileinput__file-list" data-js-file="list">
<template data-js-file="listitem-template">
<div class="c-fileinput__item" data-js-file="listitem" data-js-file-id="">
<div class="c-fileinput__item-container">
<div class="c-fileinput__item-icon-wrapper">
<!-- icon.blade.php -->
<span class="c-icon c-fileinput__item-icon c-icon--attach-file c-icon--material c-icon--material-attach_file material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-sm" aria-hidden="false" data-js-file="icon" data-material-symbol="attach_file" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" data-uid="69f073686ddd1">
</span>
</div>
<div class="c-fileinput__item-text">
<span class="c-fileinput__item-name" data-js-file="filename"></span>
<span class="c-fileinput__item-size" data-js-file="filesize"></span>
</div>
<div class="c-fileinput__item-remove" data-tooltip="Remove file">
<button class="c-button c-fileinput__item-remove-button c-button__basic c-button__basic--default c-button--sm c-button--icon-only" aria-label="Remove file" data-js-file="remove" type="button" data-uid="69f073686de1d">
<span class="c-button__label"> <span class="c-button__loader"></span>
<span class="c-button__label-icon ">
<!-- icon.blade.php -->
<span class="c-icon c-icon--delete c-icon--material c-icon--material-delete material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-sm" aria-hidden="false" data-material-symbol="delete" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" data-uid="69f073686de6b">
</span>
</span>
</span> </button> </div>
</div>
</div>
</template> </div>
<div class="c-fileinput__accepted-files-wrapper" data-js-file="counter-wrapper">
<div class="c-element" data-uid="69f073686dee7">
<div class="c-element c-fileinput__accepted-files" data-uid="69f073686deb5">
Allowed files: Audios Videos Images
</div>
</div>
<div class="c-element c-fileinput__filecounter" data-js-file="counter" data-counter-current="0" data-counter-max="1" aria-hidden="true" aria-live="polite" data-uid="69f073686df16">
/
</div>
</div>
</div> </div>
</div>
</form>
@form(['classList' => ['u-padding__y--4']])
@fileinput([
'multiple' => false,
'label' => 'Choose files',
'description' => 'Display as a file input area (dropzone, single file).',
])
@endfileinput
@endform
Fileinput by drag and drop, multiple files
<!-- form.blade.php -->
<form class="c-form u-padding__y--4 js-form-validation" id="id_69f073686e474" data-uid="69f073686e47d" method="POST" action="#">
<!-- fileinput.blade.php -->
<div class="c-field c-fileinput is-empty" data-js-file="dropzone" data-js-file-max="10" data-js-file-min="0" data-js-file-is-multi="1" id="id_69f073686e02a" data-uid="69f073686e03b">
<template class="c-element" data-js-file="notice-template" data-js-upload-error-message="Following files could not be uploaded" data-js-upload-error-message-min-files="Please upload more files" data-uid="69f073686e101">
<!-- notice.blade.php -->
<div class="c-notice c-notice--danger" id="id_69f073686e076" data-uid="69f073686e082" aria-labelledby="notice__text__id_69f073686e076">
<span class="c-notice__icon">
<!-- icon.blade.php -->
<span class="c-icon c-icon--error c-icon--material c-icon--material-error material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-lg" data-material-symbol="error" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" aria-hidden="false" data-uid="69f073686e0be">
</span>
</span>
<span id="notice__text__id_69f073686e076" data-js-notice-message="true" class="c-notice__message">
<!-- Message -->
</span>
</div>
</template>
<label class="c-element c-field__label c-fileinput__label" for="input_id_69f073686e02a" id="label_id_69f073686e02a" data-js-file="label" data-uid="69f073686e137">
Choose files
</label>
<!-- Actual input -->
<input type="file"
class="c-fileinput__input"
name="files[]"
id="input_id_69f073686e02a"
accept="audio/*,video/*,image/*"
multiple
data-js-file="input"
aria-hidden="true"
tabindex="-1"
>
<div class="c-fileinput__inner c-fileinput__inner--area">
<div class="c-fileinput__area" data-js-file="area">
<!-- typography.blade.php original: p -->
<p class="c-typography c-field__description c-fileinput__description u-margin__top--1 u-margin__bottom--3 c-typography__variant--meta" data-uid="69f073686e189">
Display as a file input area (dropzone, multi file).
</p>
<!-- This button is used to trigger the file input -->
<button class="c-button c-fileinput__button js-file-input-button c-button__basic c-button__basic--default c-button--md" data-js-file="button" aria-live="polite" type="button" aria-label="Select file" data-uid="69f073686e1d1">
<span class="c-button__label"> <span class="c-button__loader"></span>
<span class="c-button__label-icon ">
<!-- icon.blade.php -->
<span class="c-icon c-icon--file-upload c-icon--material c-icon--material-file_upload material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-md" aria-hidden="false" data-material-symbol="file_upload" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" data-uid="69f073686e211">
</span>
</span>
<span class="c-button__label-text ">
Select file
</span>
</span> </button>
<!-- This button is used to illustrate drag and drop, it has no function -->
<button class="c-button js-file-input-drop c-button__basic c-button__basic--default c-button--md" data-js-file="drop" aria-hidden="true" type="button" aria-label="Drop files here" data-uid="69f073686e262">
<span class="c-button__label"> <span class="c-button__loader"></span>
<span class="c-button__label-icon ">
<!-- icon.blade.php -->
<span class="c-icon c-icon--place-item c-icon--material c-icon--material-place_item material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-md" aria-hidden="false" data-material-symbol="place_item" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" data-uid="69f073686e2a8">
</span>
</span>
<span class="c-button__label-text ">
Drop files here
</span>
</span> </button>
<div class="c-fileinput__file-list" data-js-file="list">
<template data-js-file="listitem-template">
<div class="c-fileinput__item" data-js-file="listitem" data-js-file-id="">
<div class="c-fileinput__item-container">
<div class="c-fileinput__item-icon-wrapper">
<!-- icon.blade.php -->
<span class="c-icon c-fileinput__item-icon c-icon--attach-file c-icon--material c-icon--material-attach_file material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-sm" aria-hidden="false" data-js-file="icon" data-material-symbol="attach_file" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" data-uid="69f073686e30d">
</span>
</div>
<div class="c-fileinput__item-text">
<span class="c-fileinput__item-name" data-js-file="filename"></span>
<span class="c-fileinput__item-size" data-js-file="filesize"></span>
</div>
<div class="c-fileinput__item-remove" data-tooltip="Remove file">
<button class="c-button c-fileinput__item-remove-button c-button__basic c-button__basic--default c-button--sm c-button--icon-only" aria-label="Remove file" data-js-file="remove" type="button" data-uid="69f073686e353">
<span class="c-button__label"> <span class="c-button__loader"></span>
<span class="c-button__label-icon ">
<!-- icon.blade.php -->
<span class="c-icon c-icon--delete c-icon--material c-icon--material-delete material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-sm" aria-hidden="false" data-material-symbol="delete" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" data-uid="69f073686e39a">
</span>
</span>
</span> </button> </div>
</div>
</div>
</template> </div>
<div class="c-fileinput__accepted-files-wrapper" data-js-file="counter-wrapper">
<div class="c-element" data-uid="69f073686e410">
<div class="c-element c-fileinput__accepted-files" data-uid="69f073686e3e0">
Allowed files: Audios Videos Images
</div>
</div>
<div class="c-element c-fileinput__filecounter" data-js-file="counter" data-counter-current="0" data-counter-max="10" aria-hidden="true" aria-live="polite" data-uid="69f073686e43c">
/
</div>
</div>
</div> </div>
</div>
</form>
@form(['classList' => ['u-padding__y--4']])
@fileinput([
'multiple' => true,
'label' => 'Choose files',
'description' => 'Display as a file input area (dropzone, multi file).',
])
@endfileinput
@endform
Fileinput with minimum number of files
<!-- form.blade.php -->
<form class="c-form u-padding__y--4 js-form-validation" id="id_69f073686e97b" data-uid="69f073686e983" method="POST" action="#">
<!-- fileinput.blade.php -->
<div class="c-field c-fileinput c-fileinput--preview is-empty" data-js-file-preview="1" data-js-file="dropzone" data-js-file-max="10" data-js-file-min="2" data-js-file-is-multi="1" id="id_69f073686e4f7" data-uid="69f073686e509">
<template class="c-element" data-js-file="notice-template" data-js-upload-error-message="Following files could not be uploaded" data-js-upload-error-message-min-files="Please upload more files" data-uid="69f073686e5c6">
<!-- notice.blade.php -->
<div class="c-notice c-notice--danger" id="id_69f073686e53f" data-uid="69f073686e54b" aria-labelledby="notice__text__id_69f073686e53f">
<span class="c-notice__icon">
<!-- icon.blade.php -->
<span class="c-icon c-icon--error c-icon--material c-icon--material-error material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-lg" data-material-symbol="error" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" aria-hidden="false" data-uid="69f073686e585">
</span>
</span>
<span id="notice__text__id_69f073686e53f" data-js-notice-message="true" class="c-notice__message">
<!-- Message -->
</span>
</div>
</template>
<label class="c-element c-field__label c-fileinput__label" for="input_id_69f073686e4f7" id="label_id_69f073686e4f7" data-js-file="label" data-uid="69f073686e5fb">
Choose files
</label>
<!-- Actual input -->
<input type="file"
class="c-fileinput__input"
name="files[]"
id="input_id_69f073686e4f7"
accept="audio/*,video/*,image/*"
multiple
data-js-file="input"
aria-hidden="true"
tabindex="-1"
>
<div class="c-fileinput__inner c-fileinput__inner--area">
<div class="c-fileinput__area" data-js-file="area">
<!-- typography.blade.php original: p -->
<p class="c-typography c-field__description c-fileinput__description u-margin__top--1 u-margin__bottom--3 c-typography__variant--meta" data-uid="69f073686e64c">
Display as a file input area (dropzone, multi file).
</p>
<!-- This button is used to trigger the file input -->
<button class="c-button c-fileinput__button js-file-input-button c-button__basic c-button__basic--default c-button--md" data-js-file="button" aria-live="polite" type="button" aria-label="Select file" data-uid="69f073686e690">
<span class="c-button__label"> <span class="c-button__loader"></span>
<span class="c-button__label-icon ">
<!-- icon.blade.php -->
<span class="c-icon c-icon--file-upload c-icon--material c-icon--material-file_upload material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-md" aria-hidden="false" data-material-symbol="file_upload" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" data-uid="69f073686e6da">
</span>
</span>
<span class="c-button__label-text ">
Select file
</span>
</span> </button>
<!-- This button is used to illustrate drag and drop, it has no function -->
<button class="c-button js-file-input-drop c-button__basic c-button__basic--default c-button--md" data-js-file="drop" aria-hidden="true" type="button" aria-label="Drop files here" data-uid="69f073686e725">
<span class="c-button__label"> <span class="c-button__loader"></span>
<span class="c-button__label-icon ">
<!-- icon.blade.php -->
<span class="c-icon c-icon--place-item c-icon--material c-icon--material-place_item material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-md" aria-hidden="false" data-material-symbol="place_item" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" data-uid="69f073686e763">
</span>
</span>
<span class="c-button__label-text ">
Drop files here
</span>
</span> </button>
<div class="c-fileinput__file-list" data-js-file="list">
<template data-js-file="listitem-template">
<div class="c-fileinput__item" data-js-file="listitem" data-js-file-id="">
<div class="c-fileinput__item-preview" data-js-file="preview">
<!-- icon.blade.php -->
<span class="c-icon c-fileinput__attachment-icon c-icon--attach-file c-icon--material c-icon--material-attach_file material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-xl" aria-hidden="false" data-js-file="icon" data-material-symbol="attach_file" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" data-uid="69f073686e7e1">
</span>
</div>
<div class="c-fileinput__info-container">
<span class="c-fileinput__item-name" data-js-file="filename"></span>
<span class="c-fileinput__item-size" data-js-file="filesize"></span>
</div>
<div class="c-fileinput__item-remove" data-tooltip="Remove file">
<button class="c-button c-fileinput__item-remove-button c-button__filled c-button__filled--primary c-button--xs" aria-label="Remove file" data-js-file="remove" type="button" data-uid="69f073686e868">
<span class="c-button__label"> <span class="c-button__loader"></span>
<!-- icon.blade.php -->
<span class="c-icon c-fileinput__item-icon c-icon--delete c-icon--material c-icon--material-delete material-symbols material-symbols-rounded material-symbols-sharp material-symbols-outlined c-icon--size-sm" aria-hidden="false" data-js-file="icon" data-material-symbol="delete" role="img" data-nosnippet="" translate="no" aria-label="Icon: Undefined" data-uid="69f073686e827">
</span>
</span> </button> </div>
</div>
</template> </div>
<div class="c-fileinput__accepted-files-wrapper" data-js-file="counter-wrapper">
<div class="c-element" data-uid="69f073686e8d7">
<div class="c-element c-fileinput__accepted-files" data-uid="69f073686e8a7">
Allowed files: Audios Videos Images
</div>
</div>
<div class="c-element c-fileinput__filecounter" data-js-file="counter" data-counter-current="0" data-counter-max="10" aria-hidden="true" aria-live="polite" data-uid="69f073686e902">
/
</div>
</div>
</div> </div>
</div>
<br>
<button class="c-button c-button__filled c-button__filled--default c-button--md" type="submit" aria-label="Submit" data-uid="69f073686e945">
<span class="c-button__label"> <span class="c-button__loader"></span>
<span class="c-button__label-text ">
Submit
</span>
</span> </button>
</form>
@form(['classList' => ['u-padding__y--4']])
@fileinput([
'multiple' => true,
'filesMin' => 2,
'label' => 'Choose files',
'preview' => true,
'description' => 'Display as a file input area (dropzone, multi file).',
])
@endfileinput
<br>
@button([
'type' => 'submit',
'text' => 'Submit',
])
@endbutton
@endform
Blade component parameters
| Key | Default value | Type | Available values | Description |
| description | string | - | Additional description or instructions. | |
| name | files | string | - | files |
| accept | audio/*,video/*,image/* | string | - | What file types to accept. Use MIME types. Example: audio/*,video/*,image/* |
| multiple | false | boolean | - | Allow single or multiple files |
| label | string | - | Label to show on the field | |
| buttonLabel | Select file | string | - | What text to show on the button |
| buttonRemoveLabel | Remove file | string | - | What text to show on the remove button |
| buttonDropLabel | Drop files here | string | - | A label for the drop area |
| preview | false | boolean | - | - |
| maxSize | NULL | - | Maximum file size allowed in MB. Number (int) in bytes or string (small, medium, large). Default is null (no limit). | |
| uploadErrorMessage | NULL | - | Message to show when upload fails | |
| uploadErrorMessageMinFiles | NULL | - | Message to show when minimum number of files is not met | |
| icon | file_upload | string | - | @link:component/icon |
| required | false | boolean | - | If field is required |
| filesMax | 1 | integer | - | Maximum number of files (int). Foced to 1 if multiple is false. Default 10 for multiple. |
| filesMin | 0 | integer | - | Minimum number of files (int). Default is 0. |
| id | string | - | The DOM id of the component. | |
| classList | [] | array | - | Array containing wrapping classes array |
| attributeList | [] | array | - | Array containing keys and values rendered as attributes |
| containerAware | false | boolean | true/false | Makes the component container aware. Appends modifiers --size--xs/sm/md/lg to the component. |