<tmplx>

Build state-driven web app with Go in HTML.

Get Started

Demo: To Do App

Source Code:

 <script type="text/tmplx">
var list []string = []string{}
var item string = ""

func add() {
  list = append(list, item)
  item = ""
}

func remove(i int) {
  list = append(list[0:i], list[i+1:]...)
}
</script>

<label>New <input type="text" tx-value="item"></label>
<button tx-onclick="add()">Add</button>
<ol>
  <li tx-for="i, l := range list" tx-key="l" tx-onclick="remove(i)">
    { l }
  </li>
</ol> 

It allows you to build UIs with React-like reactivity purely in Go.

Compiled Code: