protonemedia / laravel-form-components

A set of Blade components to rapidly build forms with Tailwind CSS (v1.0 and v2.0) and Bootstrap 4/5. Supports validation, model binding, default values, translations, Laravel Livewire, includes default vendor styling and fully customizable!

Home Page:https://protone.media/blog/laravel-form-components-to-rapidly-build-forms-with-tailwind-css-and-bootstrap-4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove or alter the "mt-4"

wrabit opened this issue · comments

commented

Would be nice to able to control this via something like

<x-form-input field-class="mb-2" />

IMO too much spacing for a compact form, better to be adjustable.

Something like:

FormInput.php

        string $name,
        string $label = '',
        string $type = 'text',
        string $fieldClass = 'mt-4'
...

form-input.blade.php

        <div class="@if($type === 'hidden') hidden @else $fieldClass @endif">
commented

Maybe wrapper-class is more generic.

You can publish the Blade views and customize to your needs:
https://github.com/protonemedia/laravel-form-components#customize-the-blade-views