lukasleitsch / kirby-blade

Enable Laravel Blade Template Engine for Kirby 4
MIT License
17 stars 4 forks source link

Documentation on how to use components #37

Closed mxub closed 1 month ago

mxub commented 1 month ago

Hey everyone,

Firstly: thank you for providing this plugin.

The readme mentions

You can use the power of Blade like Layouts, Forms, Sub-Views, Components, Directives and your custom if statements.

I'm mostly interested in creating components for better work with tailwind. Sadly I don't understand how to get that working.

A little more examples in the documentation would be awesome so that someone like me can get started right away.

My goal for now:

I want a <x-hello /> tag that inserts <span>Hello World</span>

When writing components for your own application, components are automatically discovered within the app/View/Components directory and resources/views/components directory. -- Blade Documentation

Any pointers on where to start would be highly appreciated. It feels like it belongs somewhat to #20 but I would need some pointers to start becoming helpful...

File Structure as I would imagine

site/Templates/
. default.blade.php
. View/Componens/
. . hello.blade.php
lukasleitsch commented 1 month ago

Yes, these features are not really well-documented. I created a PR #38 with more details about using components.

Please have a look and try to use it. Feedback is appreciated.

lukasleitsch commented 1 month ago

The updated README is now available in the main branch.

https://github.com/lukasleitsch/kirby-blade/tree/main?tab=readme-ov-file#anonymous-components