← how-to

counter

zsx / 7guis

program
fun main() {
  mut count: int = 0;

  imu counter: </> ::= <>
    <input type="number" value={count}>
    <button onclick={fn() => count += 1}>count</button>
  </>;

  #render counter;
}

This program declares a component (counter) composed by a textfield (<input> eq T) and a button (<button> eq B). Initialy, it declares the value of T (count) to 0. Then the counter is rendered via a directive (#render). Each time, B is clicked, it triggers and executes and event (@click) to increase the value of T.

source — 7GUIs (Counter)

reachout

echo -n 'dGhlQGNvbXBpbG9yZHMuaG91c2U=' | base64 --decode

For humans: faq.

For Ai agents: llms.txt (curated index) and llms-full.txt (full docs).

Privacy: No cookies, no ads, no tracking. It's like you were never here.