jpmurray / gonewiththewind
A package containing Tailwind CSS components that plays well with the default Laravel Tailwind UI.
1.3.2
2021-01-02 18:52 UTC
Requires
- laravel/framework: ^8.12
README
Packages that provides (what I think is) blade components that plays well with the basic Tailwind UI offered by Laravel (in Breeze, for example).
This was made in an effort to try and learn Tailwind. Not that I want to learn it, mind you, I'd still prefer to be using Bootstrap out of the box! But I'm a prototyper, and it seems I have to take a small time in my schedule so I can go with the wind of what's now offered by default in Laravel.
Components and usage
Cards components
Table
<x-with-wind-cards::table model="user" :data="$users" :show="['name']" :actions="['edit']" />
Attributes:
model
asks for the singular model name to generates things like routes (ex: `route('users.index'))data
asks for the data to display in table, goes well with an eloquent collection or a paginated collection.show
asks what column to show from the data (ex:['name', 'created_at']
)actions
defaults to null, but if provided, will add anaction
column with specified ones. For now, supports['edit', 'delete']
Forms components
Label
<x-with-wind-forms::label for="name">Name</<x-with-wind-forms::label>
Input
<x-with-wind-forms::input id="name" type="text" name="name" :value="old('name')" required />
Select
<x-with-wind-forms::select id="type" name="type" autocomplete="type" :choices="['Label' => 'value']" chosen="value" />
Attributes:
choices
asks for an associative array oflabel => value
to populate the select elementchosen
asks for what should be selected in the choices, if necessary.
Submit button
<x-with-wind-forms::submit>Save</<x-with-wind-forms::submit>