Skip to main content

Introduction

OpenTUI is a native terminal UI core written in Zig with TypeScript bindings. The native core exposes a C ABI and can be used from any language. OpenTUI powers OpenCode in production today and will also power terminal.shop. It is an extensible core with a focus on correctness, stability, and high performance.

Key features

OpenTUI provides a component-based architecture with flexible layout capabilities, allowing you to create complex terminal applications:
  • Native performance - Written in Zig with a focus on correctness and high performance
  • Component-based architecture - Build UIs with reusable, composable components
  • Flexible layouts - Uses the Yoga layout engine for CSS Flexbox-like capabilities
  • Cross-language support - C ABI allows usage from any language
  • Rich components - Text, boxes, inputs, selects, tabs, and more
  • Advanced rendering - FrameBuffer API for custom graphics and visual effects
  • Built-in console - Integrated debug console with log capture
  • Theme support - Automatic dark/light mode detection
  • Production-ready - Powers OpenCode in production

Get started

Quickstart

Build your first TUI app in minutes

Installation

Install OpenTUI with your package manager

Core concepts

Learn the fundamentals of OpenTUI

Quick example

Here’s a simple example to get you started:
import { createCliRenderer, TextRenderable } from "@opentui/core"

const renderer = await createCliRenderer()

const greeting = new TextRenderable(renderer, {
  id: "greeting",
  content: "Hello, OpenTUI!",
  fg: "#00FF00",
  position: "absolute",
  left: 10,
  top: 5,
})

renderer.root.add(greeting)
Use create-tui to quickly scaffold a new OpenTUI project:
bun create tui

Why OpenTUI?

OpenTUI combines the best of both worlds: native performance through Zig with the developer experience of TypeScript. The architecture provides:
  • Correctness - Type-safe APIs with comprehensive error handling
  • Stability - Battle-tested in production with OpenCode
  • Performance - Native Zig core for maximum efficiency
  • Extensibility - Component-based design for easy customization
  • Flexibility - Works with React, SolidJS, or imperative APIs

Next steps

Installation guide

Set up OpenTUI with system requirements

Build your first app

Follow our quickstart tutorial

Build docs developers (and LLMs) love