opentui-core[official]

OpenTUI Core

OpenTUI is a TypeScript library for building terminal user interfaces on a native Zig core.

@opentui/core supplies the renderer and TypeScript API. The TypeScript packages call native Zig through an internal foreign function interface (FFI) boundary.

import { TextRenderable, createCliRenderer } from "@opentui/core"

const renderer = await createCliRenderer({ exitOnCtrlC: true })

renderer.root.add(new TextRenderable(renderer, { content: "Hello, OpenTUI!" }))

exitOnCtrlC: true calls renderer.destroy() when the user presses Ctrl+C. The code that creates the renderer must call renderer.destroy() on every other shutdown path.

Read the components overview, runtime and platform support, API and symbol index, package entry points, and standalone executables. See lifecycle and cleanup for other shutdown paths.