Text Reactive

A minimal counter demo that updates text live when state changes.

Reactive text

Count: 1

PHP
<?php $count = state(1); $app = div([ cls('container') ], [ h1([], [ text('Reactive text')]), p([], [ text(concat('Count: ', read($count))) ]), button([ on('click', inc($count, 1)), cls('btn btn-primary') ],[ text('Inc') ]), ]);