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_6977defcc7f38" data-uid="6977defcc7f42" 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_6977defcc78d8" data-uid="6977defcc78f4">
<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="6977defcc7b46">
<!-- notice.blade.php -->
<div class="c-notice c-notice--danger" id="id_6977defcc796f" data-uid="6977defcc797e" aria-labelledby="notice__text__id_6977defcc796f">
<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="6977defcc7aca">
</span>
</span>
<span id="notice__text__id_6977defcc796f" 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_6977defcc78d8" id="label_id_6977defcc78d8" data-js-file="label" data-uid="6977defcc7b82">
Choose files
</label>
<!-- Actual input -->
<input type="file"
class="c-fileinput__input"
name="files"
id="input_id_6977defcc78d8"
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="6977defcc7c1a">
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="6977defcc7c82">
<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="6977defcc7cc6">
</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="6977defcc7d0f">
<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="6977defcc7d47">
</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="6977defcc7dad">
</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="6977defcc7dee">
<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="6977defcc7e25">
</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="6977defcc7e8d">
<div class="c-element c-fileinput__accepted-files" data-uid="6977defcc7e63">
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="6977defcc7ebb">
/
</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_6977defcc83a3" data-uid="6977defcc83ac" 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_6977defcc7fc7" data-uid="6977defcc7fd8">
<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="6977defcc8090">
<!-- notice.blade.php -->
<div class="c-notice c-notice--danger" id="id_6977defcc800d" data-uid="6977defcc8019" aria-labelledby="notice__text__id_6977defcc800d">
<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="6977defcc8051">
</span>
</span>
<span id="notice__text__id_6977defcc800d" 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_6977defcc7fc7" id="label_id_6977defcc7fc7" data-js-file="label" data-uid="6977defcc80c2">
Choose files
</label>
<!-- Actual input -->
<input type="file"
class="c-fileinput__input"
name="files[]"
id="input_id_6977defcc7fc7"
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="6977defcc8110">
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="6977defcc814d">
<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="6977defcc8189">
</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="6977defcc81ce">
<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="6977defcc8207">
</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="6977defcc826a">
</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="6977defcc82a7">
<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="6977defcc82dc">
</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="6977defcc8343">
<div class="c-element c-fileinput__accepted-files" data-uid="6977defcc831a">
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="6977defcc836a">
/
</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_6977defcc87f9" data-uid="6977defcc8801" 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_6977defcc8413" data-uid="6977defcc8423">
<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="6977defcc84c8">
<!-- notice.blade.php -->
<div class="c-notice c-notice--danger" id="id_6977defcc8452" data-uid="6977defcc845d" aria-labelledby="notice__text__id_6977defcc8452">
<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="6977defcc8490">
</span>
</span>
<span id="notice__text__id_6977defcc8452" 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_6977defcc8413" id="label_id_6977defcc8413" data-js-file="label" data-uid="6977defcc84f7">
Choose files
</label>
<!-- Actual input -->
<input type="file"
class="c-fileinput__input"
name="files[]"
id="input_id_6977defcc8413"
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="6977defcc853e">
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="6977defcc8576">
<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="6977defcc85ae">
</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="6977defcc85ee">
<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="6977defcc8623">
</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="6977defcc8688">
</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="6977defcc86fc">
<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="6977defcc86c4">
</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="6977defcc875d">
<div class="c-element c-fileinput__accepted-files" data-uid="6977defcc8734">
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="6977defcc8792">
/
</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="6977defcc87cc">
<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. |