-
-
Notifications
You must be signed in to change notification settings - Fork 86
BaseField Styling
tanthammar edited this page Sep 28, 2020
·
11 revisions
- Default sm:w-2/3
Display the label to the left of the field. Overrides the form component inline attribute.
Display the label above the field. Overrides the form component inline attribute.
- Default 12 of 12 columns
- Merge or replace classes on the field wrapper div
php artisan vendor:publish --tag=form-config
With these methods you merge OR override the field-attribute
values set in the config file.
Input::make('Name')->labelAttr('bg-green-300') //merge with config
Input::make('Name')->labelAttr('bg-green-300', false) //replace config
The methods are not just for styling you can set any attributes on the elements. See another example on the Form Slots page.
Input::make('Name')
->rootAttr([
'x-data' => "{ foo: 'bar'}",
'class' => 'border rounded',
])
->inputAttr([
'x-init' => "foo = 'baz'"
])
->required(),
- Read about it on the Attributes page
- Override
field-attribute['root']
in the config file
- Override
field-attribute['before']
in the config file
- Override
field-attribute['before-text']
in the config file
- Override
field-attribute['above']
in the config file
- Override
field-attribute['below']
in the config file
- Override
field-attribute['below-wrapper']
in the config file
- Override
field-attribute['after']
in the config file
- Override
field-attribute['after-text']
in the config file
- Override
field-attribute['label']
in the config file
- Override
field-attribute['label-suffix']
in the config file
- Override
field-attribute['after-label']
in the config file
- Installation
- Requirements
- v5 Upgrade Guide
- v6 Upgrade Guide
- v7 Upgrade Guide
- Support
- Quickstart
- Manual installation
- Optional
- Form component
- Field
- Field types
- Example Form
- Blade Components
- Notifications