Versions in this module Expand all Collapse all v0 v0.1.0 Dec 25, 2025 Changes in this version + func Box(child Node) *boxNode + func Divider() *dividerNode + func Empty() *emptyNode + func HStack(children ...Node) *hstackNode + func If[T any](cond bool, a, b T) T + func Markdown(content string) *markdownNode + func Run(root func(C) Node) error + func ScrollBox(c C, child Node) *componentNode + func Spacer() *spacerNode + func StringWidth(s string) int + func TailBox(c C, child Node) *componentNode + func Text(content string) *textNode + func UseContext[T any](c C, ctx *Context[T]) T + func UseEffect(c C, fn func() func(), deps ...any) + func UseKey(c C, handler func(key Key, r rune)) + func UseMemo[T any](c C, fn func() T, deps ...any) T + func UseMouse(c C, handler func(ev MouseEvent)) + func VStack(children ...Node) *vstackNode + func When(condition bool, node Node) *whenNode + func WhenElse(condition bool, trueNode, falseNode Node) *whenElseNode + type Align int + const AlignCenter + const AlignLeft + const AlignRight + type BorderChars struct + BottomLeft rune + BottomRight rune + Horizontal rune + TopLeft rune + TopRight rune + Vertical rune + type BorderStyle int + const BorderDouble + const BorderNone + const BorderRounded + const BorderSingle + const BorderThick + type Bridge struct + func UseBridge[S any, Q any, A any](c C, initial S) *Bridge[S, Q, A] + func (b *Bridge[S, Q, A]) Handle() Handle[S, Q, A] + func (b *Bridge[S, Q, A]) HasInteraction() bool + func (b *Bridge[S, Q, A]) Interaction() Q + func (b *Bridge[S, Q, A]) State() S + func (b *Bridge[S, Q, A]) Submit(answer A) + type ButtonProps struct + Label string + OnClick func() + Primary bool + type C interface + Child func(key string, index ...int) C + Quit func() + Rect func() Rect + Refresh func() + SetCursor func(x, y int) + Wrap func(node Node) *componentNode + type CheckboxProps struct + Checked bool + Label string + OnChanged func(bool) + type Color int + const Black + const Blue + const Cyan + const Default + const Gray + const Green + const Magenta + const Red + const White + const Yellow + type Context struct + func CreateContext[T any](defaultValue T) *Context[T] + func (ctx *Context[T]) Provide(c C, value T, children ...Node) Node + func (ctx *Context[T]) ProvideH(c C, value T, children ...Node) Node + type FocusManager struct + func (fm *FocusManager) Current() string + func (fm *FocusManager) CurrentContext() *componentContext + func (fm *FocusManager) Focus(key string) + func (fm *FocusManager) IsFocused(key string) bool + func (fm *FocusManager) Next() + func (fm *FocusManager) Prev() + func (fm *FocusManager) Register(key string, ctx *componentContext) + func (fm *FocusManager) Reset() + func (fm *FocusManager) Unregister(key string) + type FocusState struct + Blur func() + Focus func() + IsFocused bool + func UseFocus(c C) FocusState + type Handle interface + Ask func(question Q) A + Update func(state S) + type Key int + const KeyBackspace + const KeyCtrlA + const KeyCtrlB + const KeyCtrlC + const KeyCtrlD + const KeyCtrlE + const KeyCtrlF + const KeyCtrlG + const KeyCtrlH + const KeyCtrlI + const KeyCtrlJ + const KeyCtrlK + const KeyCtrlL + const KeyCtrlN + const KeyCtrlO + const KeyCtrlP + const KeyCtrlQ + const KeyCtrlR + const KeyCtrlS + const KeyCtrlT + const KeyCtrlU + const KeyCtrlV + const KeyCtrlW + const KeyCtrlX + const KeyCtrlY + const KeyCtrlZ + const KeyDelete + const KeyDown + const KeyEnd + const KeyEnter + const KeyEsc + const KeyF1 + const KeyF10 + const KeyF11 + const KeyF12 + const KeyF2 + const KeyF3 + const KeyF4 + const KeyF5 + const KeyF6 + const KeyF7 + const KeyF8 + const KeyF9 + const KeyHome + const KeyInsert + const KeyLeft + const KeyNone + const KeyPageDown + const KeyPageUp + const KeyRight + const KeySpace + const KeyTab + const KeyUp + type Modifiers int + const ModAlt + const ModCtrl + const ModNone + const ModShift + type MouseButton int + const MouseButtonLeft + const MouseButtonMiddle + const MouseButtonNone + const MouseButtonRight + type MouseEvent struct + Button MouseButton + Type MouseEventType + X int + Y int + type MouseEventType int + const MouseEventClick + const MouseEventMove + const MouseEventPress + const MouseEventRelease + const MouseEventScrollDown + const MouseEventScrollUp + type Node interface + func Button(c C, props ButtonProps) Node + func Center(child Node) Node + func Checkbox(c C, props CheckboxProps) Node + func Cursor(c C) Node + func For[T any](items []T, render func(item T, index int) Node) Node + func Spinner(c C, label string) Node + func Stats(c C) Node + func TextInput(c C, props TextInputProps) Node + type Rect struct + H int + W int + X int + Y int + func (r Rect) Contains(x, y int) bool + type Ref struct + Current T + func UseRef[T any](c C, initial T) *Ref[T] + type Runtime struct + func NewTestRuntime(root func(C) Node, screen tcell.Screen) *Runtime + func (r *Runtime) DispatchKey(key tcell.Key, r_rune rune, mod tcell.ModMask) + func (r *Runtime) Render() + func (r *Runtime) Run() error + type State struct + Val T + func Use[T any](c C, key string, initial T) *State[T] + func (s *State[T]) Set(value T) + func (s *State[T]) Update(fn func(old T) T) + type Style struct + func NewStyle() Style + func (s Style) Align(a Align) Style + func (s Style) Background(c Color) Style + func (s Style) Blink() Style + func (s Style) Bold() Style + func (s Style) Border(style BorderStyle) Style + func (s Style) BorderColor(c Color) Style + func (s Style) Dim() Style + func (s Style) Flex(f int) Style + func (s Style) Foreground(c Color) Style + func (s Style) Height(h int) Style + func (s Style) Italic() Style + func (s Style) Padding(v, h int) Style + func (s Style) PaddingAll(top, right, bottom, left int) Style + func (s Style) Underline() Style + func (s Style) Valign(a Align) Style + func (s Style) Width(w int) Style + type TextInputProps struct + Height int + Label string + Multiline bool + OnChanged func(string) + OnSubmit func(string) + Password bool + Placeholder string + Value string + Width int