Comprehensive OpenTUI skill for building terminal user interfaces. Covers the core imperative API, React reconciler, and Solid reconciler...
Consolidated skill for building terminal user interfaces with OpenTUI. Use decision trees below to find the right framework and components, then load detailed references.
Follow these rules in all OpenTUI code:
create-tui for new projects. See framework REFERENCE.md quick starts.create-tui options must come before arguments. bunx create-tui -t react my-app works, bunx create-tui my-app -t react does NOT.process.exit() directly. Use renderer.destroy() (see core/gotchas.md).components/text-display.md).Framework references follow a 5-file pattern. Cross-cutting concepts are single-file guides.
Each framework in ./references/<framework>/ contains:
| File | Purpose | When to Read |
|---|---|---|
REFERENCE.md |
Overview, when to use, quick start | Always read first |
api.md |
Runtime API, components, hooks | Writing code |
configuration.md |
Setup, tsconfig, bundling | Configuring a project |
patterns.md |
Common patterns, best practices | Implementation guidance |
gotchas.md |
Pitfalls, limitations, debugging | Troubleshooting |
Cross-cutting concepts in ./references/<concept>/ have REFERENCE.md as the entry point.
REFERENCE.md for your chosen frameworkapi.md + components/<category>.mdconfiguration.mdlayout/REFERENCE.mdkeyboard/REFERENCE.mdkeymap/REFERENCE.mdanimation/REFERENCE.mdgotchas.md + testing/REFERENCE.md./references/react/REFERENCE.md # Start here for React
./references/react/api.md # React components and hooks
./references/solid/configuration.md # Solid project setup
./references/components/inputs.md # Input, Textarea, Select docs
./references/core/gotchas.md # Core debugging tips
OpenTUI runs on Bun and uses Zig for native builds. Read ./references/core/gotchas.md for runtime requirements and build guidance.
Which framework?
ββ I want full control, maximum performance, no framework overhead
β ββ core/ (imperative API)
ββ I know React, want familiar component patterns
β ββ react/ (React reconciler)
ββ I want fine-grained reactivity, optimal re-renders
β ββ solid/ (Solid reconciler)
ββ I'm building a library/framework on top of OpenTUI
ββ core/ (imperative API)
Display content?
ββ Plain or styled text -> components/text-display.md
ββ Container with borders/background -> components/containers.md
ββ Scrollable content area -> components/containers.md (scrollbox)
ββ Standalone scrollbar -> components/containers.md (scrollbar)
ββ ASCII art banner/title -> components/text-display.md (ascii-font)
ββ PNG/JPEG/WebP/GIF image -> components/text-display.md (image)
ββ First-draw diagnostic -> components/text-display.md (time-to-first-draw)
ββ QR code -> components/text-display.md (qr-code, @opentui/qrcode)
ββ Embedded child terminal/VT output -> components/containers.md (Core only)
ββ Data table with borders/wrapping -> components/code-diff.md (TextTable)
ββ Code with syntax highlighting -> components/code-diff.md
ββ Diff viewer (unified/split, hunk nav) -> components/code-diff.md
ββ Line numbers with diagnostics -> components/code-diff.md
ββ Markdown content (streaming) -> components/code-diff.md (markdown)
User input?
ββ Single-line text field -> components/inputs.md (input)
ββ Multi-line text editor -> components/inputs.md (textarea)
ββ Select from a list (vertical) -> components/inputs.md (select)
ββ Tab-based selection (horizontal) -> components/inputs.md (tab-select)
ββ Value slider -> components/inputs.md (slider)
ββ Declarative/layered keybindings -> keymap/REFERENCE.md (@opentui/keymap)
ββ Custom keyboard shortcuts -> keyboard/REFERENCE.md
Layout?
ββ Flexbox-style layouts (row, column, wrap) -> layout/REFERENCE.md
ββ Absolute positioning -> layout/patterns.md
ββ Responsive to terminal size -> layout/patterns.md
ββ Centering content -> layout/patterns.md
ββ Complex nested layouts -> layout/patterns.md
Animations?
ββ Timeline-based animations -> animation/REFERENCE.md
ββ Easing functions -> animation/REFERENCE.md
ββ Property transitions -> animation/REFERENCE.md
ββ Looping animations -> animation/REFERENCE.md
Input handling?
ββ Keyboard events (keypress, release) -> keyboard/REFERENCE.md
ββ Layered bindings, commands, leader keys -> keymap/REFERENCE.md
ββ Focus management -> keyboard/REFERENCE.md
ββ Paste events -> keyboard/REFERENCE.md
ββ Mouse events -> components/containers.md
ββ Text selection & copy-on-select -> keyboard/REFERENCE.md (selection)
ββ Host/terminal clipboard service or OSC 52 -> keyboard/REFERENCE.md (clipboard)
Testing?
ββ Snapshot testing -> testing/REFERENCE.md
ββ Interaction testing -> testing/REFERENCE.md
ββ Test renderer setup -> testing/REFERENCE.md
ββ Debugging tests -> testing/REFERENCE.md
Platform capability?
ββ Play loaded sound or MP3/FLAC stream -> core/api.md (Audio)
ββ Capture microphone PCM / record WAV -> core/api.md (Audio)
ββ Decode, transform, or display images -> components/text-display.md (image)
ββ Read/write host or terminal clipboard -> keyboard/REFERENCE.md (clipboard)
ββ Desktop notifications (OSC 9/777/99) -> core/api.md (triggerNotification)
ββ Custom stdin/stdout (PTY, xterm.js) -> core/api.md (createCliRenderer)
ββ Serve a TUI over SSH -> core/REFERENCE.md (@opentui/ssh)
Troubleshooting?
ββ Runtime errors, crashes -> <framework>/gotchas.md
ββ Layout issues -> layout/REFERENCE.md + layout/patterns.md
ββ Input/focus issues -> keyboard/REFERENCE.md
ββ Repro + regression tests -> testing/REFERENCE.md
core/gotchas.mdcomponents/text-display.mdkeyboard/REFERENCE.mdlayout/REFERENCE.mdtesting/REFERENCE.mdFor component naming differences and text modifiers, see components/REFERENCE.md.
| Framework | Entry File | Description |
|---|---|---|
| Core | ./references/core/REFERENCE.md |
Imperative API, all primitives |
| React | ./references/react/REFERENCE.md |
React reconciler for declarative TUI |
| Solid | ./references/solid/REFERENCE.md |
SolidJS reconciler for declarative TUI |
| Concept | Entry File | Description |
|---|---|---|
| Layout | ./references/layout/REFERENCE.md |
Yoga/Flexbox layout system |
| Components | ./references/components/REFERENCE.md |
Component reference by category |
| Keyboard | ./references/keyboard/REFERENCE.md |
Low-level keyboard input handling |
| Keymap | ./references/keymap/REFERENCE.md |
Declarative layered keybindings (@opentui/keymap) |
| Animation | ./references/animation/REFERENCE.md |
Timeline-based animations |
| Testing | ./references/testing/REFERENCE.md |
Test renderer and snapshots |
| Category | Entry File | Components |
|---|---|---|
| Text & Display | ./references/components/text-display.md |
text, ascii-font, image, time-to-first-draw, styled text, qr-code |
| Containers | ./references/components/containers.md |
box, scrollbox, scrollbar, embedded-terminal, borders |
| Inputs | ./references/components/inputs.md |
input, textarea, select, tab-select, slider |
| Code & Diff | ./references/components/code-diff.md |
code, line-number, diff, markdown, text-table |
| Package | Description | Docs |
|---|---|---|
@opentui/keymap |
Layered keybinding/command engine (Bun or Node, no FFI) | ./references/keymap/REFERENCE.md |
@opentui/qrcode |
QR code component | ./references/components/text-display.md |
@opentui/ssh |
Serve a TUI over SSH | ./references/core/REFERENCE.md |
@opentui/three |
Three.js WebGPU renderer (formerly core/src/3d) |
upstream packages/three |
@opentui/examples |
Runnable examples (formerly core/src/examples) |
upstream packages/examples |
Core also ships loaded/streaming/captured Audio, native images, host and terminal clipboard services, and OSC desktop notifications.
Repository: https://github.com/anomalyco/opentui Core Docs: https://github.com/anomalyco/opentui/tree/main/packages/core/docs Examples: https://github.com/anomalyco/opentui/tree/main/packages/examples/src Awesome List: https://github.com/msmps/awesome-opentui