Skip to main content
The TUI library includes a comprehensive set of built-in components for building interactive terminal applications.

Text Components

Text

Displays multi-line text with word wrapping:

TruncatedText

Single-line text that truncates to fit:

Markdown

Renders markdown with syntax highlighting:

Input Components

Input

Single-line text input:
Key Bindings:
  • Enter - Submit
  • Ctrl+A / Ctrl+E - Line start/end
  • Ctrl+W / Alt+Backspace - Delete word
  • Ctrl+Left / Ctrl+Right - Word navigation

Editor

Multi-line editor with autocomplete:
Features:
  • Multi-line editing with word wrap
  • Slash command autocomplete
  • File path autocomplete (Tab)
  • Large paste handling
Key Bindings:
  • Enter - Submit
  • Shift+Enter / Alt+Enter - New line
  • Tab - Autocomplete
  • Ctrl+] - Jump to character

Selection Components

SelectList

Interactive selection list:
Controls:
  • Arrow keys - Navigate
  • Enter - Select
  • Escape - Cancel

SettingsList

Settings panel with value cycling:
Controls:
  • Arrow keys - Navigate
  • Enter/Space - Cycle value or open submenu
  • Escape - Cancel

Visual Components

Loader

Animated loading spinner:

CancellableLoader

Loader with abort signal:

Image

Inline images (Kitty/iTerm2):

Layout Components

Container

Groups child components:

Box

Container with padding and background:

Spacer

Empty lines for spacing:

Autocomplete

CombinedAutocompleteProvider

Slash commands and file paths:

Key Detection

Use matchesKey() for keyboard input:

Utilities

Next Steps

TUI Overview

Learn TUI concepts

API Reference

Complete component API