File input

Displays a file input.

Fileinput

<!-- fileinput.blade.php -->

<div class="c-fileinput unlist c-fileinput--area" id="6623ab1c4c19a" data-uid="6623ab1c4c1ac">
    <label class="c-fileinput__label" for="fs_6623ab1c4c19a">Choose files...</label>
    
    <input type="file"
        class="c-fileinput__input "
        name="files[]"
        id="fs_6623ab1c4c19a"
        accept="audio/*,video/*,image/*"
        multiple
        
    />

        <label class="c-button c-fileinput__button c-button__basic c-button__basic--default c-button--md" target="_top" for="fs_6623ab1c4c19a" type="button" aria-label="Choose files..." data-uid="6623ab1c4c5b6">   
            
                    <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-outlined material-symbols-outlined--filled c-icon--size-md" aria-hidden="true" material-symbol="file_upload" role="img" aria-label="Icon: Undefined" alt="Icon: Undefined" data-nosnippet="" translate="no" data-uid="6623ab1c4c638">
                file_upload
    </span>
            </span>
        
                    <span class="c-button__label-text ">
                Choose files...
            </span>
        
   </label>
      <ul class="c-fileinput__files js-form-file-input u-display--none">
            <template>
                <li>
                        <!-- icon.blade.php -->
    <span class="c-icon c-icon--attach-file c-icon--material c-icon--material-attach_file material-symbols-outlined material-symbols-outlined--filled c-icon--size-sm" material-symbol="attach_file" role="img" aria-label="Icon: Undefined" alt="Icon: Undefined" data-nosnippet="" translate="no" aria-hidden="true" data-uid="6623ab1c4c687">
                attach_file
    </span>
					<span class="u-strong js-file-input-name"></span> 
                    <span class="js-file-input-size"></span>
                        <!-- icon.blade.php -->
    <span class="c-icon c-fileinput__remove-file c-icon--delete c-icon--material c-icon--material-delete material-symbols-outlined material-symbols-outlined--filled c-icon--size-md" material-symbol="delete" role="img" aria-label="Icon: Undefined" alt="Icon: Undefined" data-nosnippet="" translate="no" aria-hidden="true" data-uid="6623ab1c4c6c0">
                delete
    </span>
				</li>
            </template>
        </ul>

</div>
@fileinput([
    'classList' => ['unlist'],
    'display' => 'area',
    'multiple' => true,
    'label' => 'Choose files...'
])
@endfileinput

Blade component parameters

Key Default value Type Available values Description
display string - Display input uploader as button or area
decription string - -
name files string - files
accept audio/*,video/*,image/* string - audio/*,video/*,image/*
multiple false boolean - Allow single or multiple files
beforeLabel string - Insert before label
afterLabel string - Input label
label string - Insert after label
buttonLabel string - -
icon file_upload string - @link:component/icon
required false boolean - If field is required
filesMax false boolean - Maximum number of files (false, int)
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.
Settings location: /var/www/webroot/ROOT/vendor/helsingborg-stad/component-library/source/php/Component/Fileinput/fileinput.json