atom-engine 5.0.2

A component-oriented template engine built on Tera with props, slots, and provide/inject context
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
{# Test: Components - Button Component #}
{%-- atom: @props(text:String, type:String="primary", disabled:Boolean=false) --%}
<button class="btn btn-{{ type }}{% if disabled %} disabled{% endif %}">
    {% if $slots.icon %}
        {{ $slots.icon() }}
    {% endif %}
    {{ text }}
</button>

{# Usage in parent: #}
{# {% component("button", {text: "Click Me", type: "primary"}) %} #}
{# {% component("button", {text: "Submit", type: "success"}) %} #}