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_690cf11ea7f84" data-uid="690cf11ea7f8c" method="POST" action="#">
<br />
<b>Deprecated</b>: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/webroot/ROOT/vendor/illuminate/support/Collection.php</b> on line <b>2060</b><br />
<br />
<b>Deprecated</b>: Return type of Illuminate\Support\Collection::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/webroot/ROOT/vendor/illuminate/support/Collection.php</b> on line <b>2071</b><br />
<br />
<b>Deprecated</b>: Return type of Illuminate\Support\Collection::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/webroot/ROOT/vendor/illuminate/support/Collection.php</b> on line <b>2083</b><br />
<br />
<b>Deprecated</b>: Return type of Illuminate\Support\Collection::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/webroot/ROOT/vendor/illuminate/support/Collection.php</b> on line <b>2098</b><br />
<br />
<b>Deprecated</b>: Return type of Illuminate\Support\Collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/webroot/ROOT/vendor/illuminate/support/Collection.php</b> on line <b>2007</b><br />
<br />
<b>Deprecated</b>: Return type of Illuminate\Support\Collection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/webroot/ROOT/vendor/illuminate/support/Collection.php</b> on line <b>1986</b><br />
<br />
<b>Deprecated</b>: Return type of Illuminate\Support\Collection::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/webroot/ROOT/vendor/illuminate/support/Collection.php</b> on line <b>1955</b><br />
<!-- fileinput.blade.php -->
<div class="c-field c-fileinput is-empty" data-js-file="dropzone" data-js-file-max="1" data-js-file-is-multi="0" id="id_690cf11ea636c" data-uid="690cf11ea63a3">
<template class="c-element" data-js-file="notice-template" data-js-upload-error-message="Following files could not be uploaded" data-uid="690cf11ea6fb5">
<!-- notice.blade.php -->
<div class="c-notice c-notice--danger" id="id_690cf11ea6dcb" data-uid="690cf11ea6de1" aria-labelledby="notice__text__id_690cf11ea6dcb">
<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="690cf11ea6f2c">
</span>
</span>
<span id="notice__text__id_690cf11ea6dcb" 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_690cf11ea636c" id="label_id_690cf11ea636c" data-js-file="label" data-uid="690cf11ea6ff1">
Choose files
</label>
<!-- Actual input -->
<input type="file"
class="c-fileinput__input"
name="files"
id="input_id_690cf11ea636c"
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--p" data-uid="690cf11ea76ff">
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="690cf11ea776e">
<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="690cf11ea77ad">
</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="690cf11ea77ee">
<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="690cf11ea7820">
</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="690cf11ea7de5">
</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="690cf11ea7e39">
<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="690cf11ea7e75">
</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="690cf11ea7eeb">
<div class="c-element c-fileinput__accepted-files" data-uid="690cf11ea7eb5">
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="690cf11ea7f14">
/
</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_690cf11ea84c1" data-uid="690cf11ea84c8" 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-is-multi="1" id="id_690cf11ea8010" data-uid="690cf11ea8022">
<template class="c-element" data-js-file="notice-template" data-js-upload-error-message="Following files could not be uploaded" data-uid="690cf11ea8122">
<!-- notice.blade.php -->
<div class="c-notice c-notice--danger" id="id_690cf11ea80a1" data-uid="690cf11ea80ae" aria-labelledby="notice__text__id_690cf11ea80a1">
<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="690cf11ea80e6">
</span>
</span>
<span id="notice__text__id_690cf11ea80a1" 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_690cf11ea8010" id="label_id_690cf11ea8010" data-js-file="label" data-uid="690cf11ea814f">
Choose files
</label>
<!-- Actual input -->
<input type="file"
class="c-fileinput__input"
name="files[]"
id="input_id_690cf11ea8010"
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--p" data-uid="690cf11ea81f9">
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="690cf11ea8235">
<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="690cf11ea826d">
</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="690cf11ea82b7">
<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="690cf11ea8326">
</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="690cf11ea83b9">
</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="690cf11ea83f1">
<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="690cf11ea841e">
</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="690cf11ea8475">
<div class="c-element c-fileinput__accepted-files" data-uid="690cf11ea8452">
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="690cf11ea8497">
/
</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
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 | - | - |
| fileMaxSize | NULL | - | - | |
| 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 | |
| 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. |
| 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. |