You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 2, 2024. It is now read-only.
[](https://plant.treeware.earth/protonemedia/laravel-form-components)
8
8
9
-
A set of Blade components to rapidly build forms with [Tailwind CSS v1](https://tailwindcss-custom-forms.netlify.app), [Tailwind CSS v2](https://tailwindcss-forms.vercel.app) and [Bootstrap 4](https://getbootstrap.com/docs/4.0/components/forms/). Supports validation, model binding, default values, translations, includes default vendor styling and fully customizable!
9
+
A set of Blade components to rapidly build forms with [Tailwind CSS v1](https://tailwindcss-custom-forms.netlify.app), [Tailwind CSS v2](https://tailwindcss-forms.vercel.app), [Bootstrap 4](https://getbootstrap.com/docs/4.0/components/forms/) and [Bootstrap 5](https://getbootstrap.com/docs/5.1/forms/overview/). Supports validation, model binding, default values, translations, includes default vendor styling and fully customizable!
10
10
11
-
#### ... 👀 There's a Pro version of this package in development: check out [formcomponents.pro](https://formcomponents.pro)!
11
+
##Launcher 🚀
12
12
13
-
### 📺 Want to see this package in action? Join the live stream on November 19 at 14:00 CET: [https://youtu.be/7eNZS4U7xyM](https://youtu.be/7eNZS4U7xyM)
13
+
Hey! We've built a Docker-based deployment tool to launch apps and sites fully containerized. You can find all features and the roadmap on our [website](https://uselauncher.com), and we are on [Twitter](https://twitter.com/uselauncher) as well!
14
14
15
15
## Features
16
16
17
+
### 📺 Want to see this package in action? Join the live stream on November 19 at 14:00 CET: [https://youtu.be/7eNZS4U7xyM](https://youtu.be/7eNZS4U7xyM)
18
+
17
19
* Components for input, textarea, select, multi-select, checkbox and radio elements.
18
20
* Support for Tailwind v1 with [Tailwind CSS Custom Forms](https://tailwindcss-custom-forms.netlify.app).
19
21
* Support for Tailwind v2 with [Tailwind Forms](https://tailwindcss-forms.vercel.app/).
20
-
* Support for [Bootstrap 4 Forms](https://getbootstrap.com/docs/4.0/components/forms/).
22
+
* Support for [Bootstrap 4 Forms](https://getbootstrap.com/docs/4.6/components/forms/).
23
+
* Support for [Bootstrap 5 Forms](https://getbootstrap.com/docs/5.1/forms/overview/).
21
24
* Component logic independent from Blade views, the Tailwind and Bootstrap views use the same logic.
22
25
* Bind a target to a form (or a set of elements) to provide default values (model binding).
23
26
* Support for [Laravel Livewire](https://laravel-livewire.com) v2.
@@ -28,6 +31,8 @@ A set of Blade components to rapidly build forms with [Tailwind CSS v1](https://
28
31
* Components classes and Blade views fully customizable.
29
32
* Support for prefixing the components.
30
33
34
+
Looking for Inertia/Vue.js support? Check out [Form Components Pro](https://github.com/protonemedia/form-components-pro)
35
+
31
36
## Requirements
32
37
33
38
* PHP 7.4 + Laravel 7.0 and higher
@@ -75,7 +80,7 @@ If you're using Tailwind, make sure the right plugin ([v1](https://github.com/ta
@@ -239,7 +244,7 @@ Normally you would use a `wire:model` attribute to bind a component property wit
239
244
@endwire
240
245
241
246
<x-form-submit>Save Contact</x-form-submit>
242
-
</form>
247
+
</x-form>
243
248
```
244
249
245
250
Additionally, you can pass an optional modifier to the `@wire` directive. This feature was added in v2.4.0. If you're upgrading from a previous version *and* you published the Blade views, you should republish them *or* update them manually.
@@ -249,7 +254,7 @@ Additionally, you can pass an optional modifier to the `@wire` directive. This f
249
254
@wire('debounce.500ms')
250
255
<x-form-input name="email" />
251
256
@endwire
252
-
</form>
257
+
</x-form>
253
258
```
254
259
255
260
### Select elements
@@ -321,8 +326,18 @@ You can group checkbox and radio elements on the same horizontal row by adding a
321
326
322
327
```blade
323
328
<x-form-group name="notification_channel" label="How do you want to receive your notifications?" inline>
@@ -396,29 +411,31 @@ By the default, the errors messages are positioned under the element. To show th
396
411
397
412
### Submit button
398
413
399
-
The label defaults to *Submit* but you can use the slot to provide your own content.
414
+
The label defaults to *Submit*, but you can use the slot to provide your own content.
400
415
401
416
```blade
402
417
<x-form-submit>
403
418
<span class="text-green-500">Send</span>
404
419
</x-form-submit>
405
420
```
406
421
407
-
### Bootstrap 4
422
+
### Bootstrap
408
423
409
-
You can switch to [Bootstrap 4](https://getbootstrap.com/docs/4.0/components/forms/) by updating the `framework` setting in the `form-components.php` configuration file.
424
+
You can switch to [Bootstrap 4](https://getbootstrap.com/docs/4.0/components/forms/)or [Bootstrap 5](https://getbootstrap.com/docs/5.0/forms/overview/)by updating the `framework` setting in the `form-components.php` configuration file.
410
425
411
426
```php
412
427
return [
413
-
'framework' => 'bootstrap-4',
428
+
'framework' => 'bootstrap-5',
414
429
];
415
430
```
416
431
417
-
There is a little bit of styling added to the `form.blade.php` view to add support for inline form groups. If you want to change it or remove it, [publish the assets](#customize-the-blade-views) and update the view file.
432
+
There is a little of styling added to the `form.blade.php` view to add support for inline form groups. If you want to change it or remove it, [publish the assets](#customize-the-blade-views) and update the view file.
433
+
434
+
Bootstrap 5 changes a lot regarding forms. If you migrate from 4 to 5, make sure to read the migration logs about [forms](https://getbootstrap.com/docs/5.0/migration/#forms).
418
435
419
-
#### Input prepend and append
436
+
#### Input group / prepend and append
420
437
421
-
In addition to the Tailwind features, there is also support for [input groups](https://getbootstrap.com/docs/4.1/components/forms/#auto-sizing). Use the `prepend` and `append` slots to provide the contents.
438
+
In addition to the Tailwind features, with Bootstrap 4, there is also support for [input groups](https://getbootstrap.com/docs/4.6/components/forms/). Use the `prepend` and `append` slots to provide the contents.
422
439
423
440
```blade
424
441
<x-form-input name="username" label="Username">
@@ -434,9 +451,28 @@ In addition to the Tailwind features, there is also support for [input groups](h
434
451
</x-form-input>
435
452
```
436
453
454
+
With Bootstrap 5, the [input groups](https://getbootstrap.com/docs/5.0/forms/input-group/) have been simplified. You can add as many items as you would like in any order you would like. Use the `form-input-group-text` component to add text or [checkboxes](https://getbootstrap.com/docs/5.0/forms/input-group/#checkboxes-and-radios).
As of Bootstrap 5, you can add [floating labels](https://getbootstrap.com/docs/5.0/forms/floating-labels/) by adding the `floating` attribute to inputs, selects (excluding `multiple`), and textareas.
0 commit comments