Traditional reactive frameworks like Angular, React or Vue can be pretty involved.
Trillo is a groundbreaking alternative which strives for simplicity.
Traditional reactive frameworks like Angular, React or Vue can be pretty involved.
Trillo is a groundbreaking alternative which strives for simplicity.
You can declare logic values and
reactive expressions
directly in HTML, using
:
-prefixed attributes and
[[...]]
blocks.
<div :count=[[0]]
:did-init=[[
setInterval(() => count++, 1000);
]]>
Seconds: [[count]]
</div>
Page logic starts in the server, to generate content-ready pages, and continues in the client, to support user interaction.
<:data-source :aka="cat"
:url="/cat-facts"/>
[[cat.content.fact]]
<button :on-click="[[
() => cat.trigger()
]]">Next</button>
With <:define>
you can turn blocks of markup into parametric
custom tags,
ready to be reused anywhere in your code.
<:define tag="app-item" :k :v>
<span>[[k]]</span>
<b :hidden=[[v < 1]]>[[v]]</b>
</:define>
<app-item :k="Inbox" :v="5"/>
<app-item :k="Sent" :v="3"/>
<app-item :k="Drafts" :v="0"/>
<app-item :k="Spam" :v="2"/>
Custom tags can be promoted to components and collected in kits, making them reusable across projects.
<head>
<:import src="/.kit/bootstrap/all.htm"/>
</head>
<body>
<bs-carousel :autoPlay=[[true]]>
<bs-carousel-item>First</bs-carousel-item>
<bs-carousel-item>Second</bs-carousel-item>
</bs-carousel>
</body>