gitstack

grindlemire/go-tui code browser

432 B 24 lines 2026-06-03 · 25447c4 raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package testdata

import (
	"fmt"

	gui "github.com/grindlemire/go-tui"
)

type aliasHelper struct{}

func (foo aliasHelper) State() string {
	return "not tui state"
}

templ Alias(counter *gui.State[int]) {
	label := gui.NewState("alias state")
	foo := aliasHelper{}

	<div border={gui.BorderSingle} padding={1}>
		<span>{label.Get()}</span>
		<span>{fmt.Sprintf("%d", counter.Get())}</span>
		<span>{foo.State()}</span>
	</div>
}