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.
Make sure the [Tailwind plugin](https://github.com/tailwindcss/custom-forms#install) is installed and added to your `tailwind.config.js` file. If you're starting a new project, you can use the [Frontend preset for Tailwind CSS](https://github.com/laravel-frontend-presets/tailwindcss) which includes the Custom Forms plugin as well.
38
38
39
-
## Configuration
40
-
41
-
There is no configuration needed unless you want to [customize the Blade views and components](#customize-the-blade-views).
42
-
43
39
## Quick example
44
40
45
41
```blade
@@ -71,9 +67,7 @@ There is no configuration needed unless you want to [customize the Blade views a
Generating HTML in PHP is always quite opinionated and limited. Blade Components are great because additional attributes are passed down to the element. That's why we prefer writing forms using components instead of using PHP builders. This way, you don't have to write extensions or custom code for any attribute you pass in. Let's take a look at this `x-form` example.
79
73
@@ -91,6 +85,12 @@ The `action` attribute is optional, but you can pass a hard-coded, primitive val
91
85
</x-form>
92
86
```
93
87
88
+
## Configuration
89
+
90
+
There is no configuration needed unless you want to [customize the Blade views and components](#customize-the-blade-views).
91
+
92
+
## Usage
93
+
94
94
### Input and textarea elements
95
95
96
96
The minimum requirement for an `input` or `textarea` is the `name` attribute.
You can provide a *slot* to the `select` element as well:
243
+
244
+
```blade
245
+
<x-form-select name="country_code">
246
+
<option value="be">Belgium</option>
247
+
<option value="nl">The Netherlands</option>
248
+
</x-form-select>
249
+
```
250
+
242
251
If you want a select element where multiple options can be selected, add the `multiple` attribute to the element. If you specify a default, make sure it is an array. This applies to bound targets as well.
0 commit comments