File Input

Where you upload stuff from your computer, like photos or documents, by clicking a button and selecting the file you want to upload.

Adding the component

php artisan spur:add forms/file-input

If you use this to add the component, it will automatically add it to config/spur.php and auto-fetch the components files.

config/spur.php
"components": [
  'forms/file-input',
]

If you manually add the component in config/spur.php you would need to run
php artisan spur:fetch to import the component

Usage

Simple File Input

<x-spur.file-input />

With Label

<x-spur.field id="accept-terms">
  <x-spur.label>Email Address</x-spur.label>
  <x-spur.file-input name="accept-terms" />
</x-spur.field>

With Label and Description

Please read the terms and conditions carefully before proceeding

<x-spur.field id="accept-terms">
  <x-spur.label>Accept Terms & Conditions</x-spur.label>
  <x-spur.file-input name="accept-terms" />
  <x-spur.description>Please read the terms and conditions carefully before proceeding</x-spur.description>
</x-spur.field>

Disabled Input

Please read the terms and conditions carefully before proceeding

<x-spur.field id="accept-terms" inline disabled>
  <x-spur.label>Accept Terms & Conditions</x-spur.label>
  <x-spur.file-input name="accept-terms" />
  <x-spur.description>Please read the terms and conditions carefully before proceeding</x-spur.description>
</x-spur.field>

Invalid Input

To process please accept terms & conditions

<x-spur.field id="accept-terms" inline invalid>
  <x-spur.label>Accept Terms & Condition</x-spur.label>
  <x-spur.file-input name="accept-terms" />
  <x-spur.description>To process please accept terms & conditions</x-spur.description>
</x-spur.field>

Multiple Files

To process please accept terms & conditions

<x-spur.field id="accept-terms" inline invalid>
  <x-spur.label>Accept Terms & Condition</x-spur.label>
  <x-spur.file-input name="accept-terms" multiple />
  <x-spur.description>To process please accept terms & conditions</x-spur.description>
</x-spur.field>

Accent Colors

<x-spur.file-input color="indigo" />
<x-spur.file-input color="blue" />
<x-spur.file-input color="green" />
<x-spur.file-input color="yellow" />
<x-spur.file-input color="red" />