These docs describe the main branch, including unreleased changes. Read the 0.6.0 docs.

API and symbol index

Use this page to find every published OpenTUI entry point and named export. The tables come from the generated publish maps and source barrels. They include runtime values and type-only exports.

The API reference lists the same exports with their signatures and the release that added each one. Releases lists the API changes of each release.

Support classes#

Class Meaning
Supported This is a normal supported API.
Advanced This API needs direct ownership, lifecycle, rendering, or integration knowledge.
Experimental This API can change as its design develops.
Runtime-specific This API works only in the runtime shown in its row.
Deprecated Keep this API only while you move to its replacement.
Implementation-looking public export The export is publicly reachable today, but OpenTUI does not endorse it for ordinary use. It is still indexed here.

A row can have more than one class. Read Runtime and platform support for the supported Bun and Node.js versions.

Entry point index#

The runtime column describes the published target. A Node stub throws during import for each Bun-only support entry point.

Package entry point Runtime Class Canonical documentation
@opentui/core Bun and Node.js Supported Renderer
@opentui/core/testing Bun and Node.js Supported Testing
@opentui/core/runtime-plugin Bun only Runtime-specific, Advanced Runtime module loading
@opentui/core/runtime-plugin-support Bun only Runtime-specific, Advanced Runtime module loading
@opentui/core/runtime-plugin-support/configure Bun only Runtime-specific, Advanced Runtime module loading
@opentui/core/yoga Bun and Node.js Advanced Yoga API
@opentui/core/tree-sitter/update-assets Build time, with Bun CLI Runtime-specific Tree-sitter
@opentui/core/parser.worker Bun and Node.js worker Implementation-looking public export Tree-sitter
@opentui/core/node-assets Node.js build time Runtime-specific Standalone executables
@opentui/react Bun and Node.js Supported React bindings
@opentui/react/renderer Bun and Node.js Supported, Implementation-looking public export React bindings
@opentui/react/test-utils Bun and Node.js Supported Testing
@opentui/react/runtime-plugin-support Bun only Runtime-specific, Advanced Runtime module loading
@opentui/react/runtime-plugin-support/configure Bun only Runtime-specific, Advanced Runtime module loading
@opentui/react/jsx-runtime Compiler selected Supported React bindings
@opentui/react/jsx-dev-runtime Compiler selected Supported React bindings
@opentui/solid Bun and Node.js Supported Solid bindings
@opentui/solid/preload Bun only Runtime-specific Solid bindings
@opentui/solid/bun-plugin Bun only Runtime-specific, Advanced Solid bindings
@opentui/solid/runtime-plugin-support Bun only Runtime-specific, Advanced Runtime module loading
@opentui/solid/runtime-plugin-support/configure Bun only Runtime-specific, Advanced Runtime module loading
@opentui/solid/components Bun and Node.js Advanced Solid bindings
@opentui/solid/jsx-runtime Compiler selected Supported Solid bindings
@opentui/solid/jsx-dev-runtime Compiler selected Supported Solid bindings
@opentui/keymap JavaScript runtimes Supported Core keymap API
@opentui/keymap/extras JavaScript runtimes Supported Core keymap API
@opentui/keymap/extras/graph JavaScript runtimes Advanced Core keymap API
@opentui/keymap/addons JavaScript runtimes Supported Built-in keymap addons
@opentui/keymap/addons/opentui Bun and Node.js Supported Built-in keymap addons
@opentui/keymap/testing JavaScript test runtimes Supported Core keymap API
@opentui/keymap/html Browser DOM Runtime-specific Keymap hosts
@opentui/keymap/opentui Bun and Node.js Runtime-specific Keymap hosts
@opentui/keymap/react OpenTUI React Runtime-specific React keymap integration
@opentui/keymap/solid OpenTUI Solid Runtime-specific Solid keymap integration
@opentui/keymap/runtime-modules Bun runtime loading Runtime-specific, Advanced Runtime module loading
@opentui/qrcode Bun and Node.js Supported QR encoder
@opentui/qrcode/react OpenTUI React Runtime-specific QR code component
@opentui/qrcode/solid OpenTUI Solid Runtime-specific QR code component
@opentui/ssh Bun 1.3.14 or Node.js 26.4.0 or later Runtime-specific SSH
@opentui/three Bun only Runtime-specific, Advanced Three.js WebGPU
@opentui/three/runtime-modules Bun only Runtime-specific, Advanced Runtime module loading

See Package entry points for each entry point’s role and import constraints.

@opentui/core#

The root works in Bun and supported Node.js releases. A class in these tables applies to every symbol in its row.

Renderer and render tree#

Area Symbols Class Canonical documentation
Renderer CliRenderer, CliRendererConfig, CliRendererErrorEvent, CliRendererExternalOutputEvent, CliRendererFrameEvent, CliRendererHandlerErrorEvent, CliRendererStats, CliRenderEvents, ConsoleMode, createCliRenderer, ExternalOutputMode, KittyKeyboardOptions, MouseButton, MouseEvent, PixelResolution, RendererControlState, ScreenMode Supported Renderer
Scheduling and scrollback RendererSchedulerState, ScrollbackRenderContext, ScrollbackSnapshot, ScrollbackSurface, ScrollbackSurfaceCommitOptions, ScrollbackSurfaceOptions, ScrollbackWriter, SplitFooterReplayResetOptions Advanced Renderer
Shared renderer types CapturedFrame, CapturedLine, CapturedSpan, CursorStyle, CursorStyleOptions, DebugOverlayCorner, ImageRenderProtocol, MousePointerStyle, RenderContext, RendererEvents, TargetChannel, TerminalCapabilities, TerminalCapabilityState, TerminalInfo, TerminalMultiplexer, ThemeMode, Timeout, ViewportBounds, WidthMethod Supported Renderer, Interaction, and Terminal capabilities
Cell and highlight types ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, Highlight, LineInfo, LineInfoProvider, TextAttributes Advanced Text and terminal cells
Renderables BaseRenderable, BaseRenderableOptions, isRenderable, LayoutEvents, LayoutOptions, Position, Renderable, RenderableEvents, RenderableOptions, RootRenderable Supported Renderables
Composition constructs ASCIIFont, Box, Code, FrameBuffer, Generic, Input, ScrollBox, Select, TabSelect, Text, vstyles Implementation-looking public export Renderables
Composition internals Construct, DelegateMap, delegate, FunctionalConstruct, h, InstantiateFn, instantiate, isVNode, maybeMakeRenderable, PendingCall, ProxiedVNode, RenderableConstructor, ValidateShape, VChild, VNode, VRenderable, VRenderableOptions, wrapWithDelegates Implementation-looking public export Renderables
Layout string parsers AlignString, BoxSizingString, DimensionString, DirectionString, DisplayString, EdgeString, FlexDirectionString, GutterString, JustifyString, LogLevelString, MeasureModeString, OverflowString, parseAlign, parseAlignItems, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, PositionTypeString, UnitString, WrapString Advanced Layout
Tree inspection visualizeRenderableTree Advanced Renderables

Input and selection#

Area Symbols Class Canonical documentation
Keyboard events KeyEvent, KeyHandler, KeyHandlerEventMap, PasteEvent Supported Keyboard input
Keyboard implementation buildKittyKeyboardFlags, InternalKeyHandler Implementation-looking public export Keyboard input
Key parser KeyEventType, nonAlphanumericKeys, ParsedKey, parseKeypress, ParseKeypressOptions, terminalNamedSingleStrokeKeys Advanced Keyboard input
Raw input parser StdinEvent, StdinParser, StdinParserOptions, StdinParserProtocolContext, StdinResponseProtocol Advanced Keyboard input
Mouse parser MouseEventType, MouseParser, RawMouseEvent, ScrollInfo Advanced Interaction, focus, and selection
Paste decoding decodePasteBytes, PasteKind, PasteMetadata, stripAnsiSequences Advanced Keyboard input
Scroll acceleration LinearScrollAccel, MacOSScrollAccel, ScrollAcceleration Advanced Interaction, focus, and selection
Selection ASCIIFontSelectionHelper, convertGlobalToLocalSelection, LocalSelectionBounds, Selection, SelectionBehavior, SelectionOccupancy Advanced Interaction, focus, and selection
Area Symbols Class Canonical documentation
Styled text bg, bgBlack, bgBlue, bgCyan, bgGreen, bgMagenta, bgRed, bgWhite, bgYellow, black, blink, blue, bold, brightBlack, brightBlue, brightCyan, brightGreen, brightMagenta, brightRed, brightWhite, brightYellow, Color, cyan, dim, fg, green, isStyledText, italic, link, magenta, red, reverse, strikethrough, stringToStyledText, StylableInput, StyleAttrs, StyledText, t, underline, white, yellow Supported Text and terminal cells
Color values ansi256IndexToRgb, ColorInput, ColorIntent, DEFAULT_BACKGROUND_RGB, DEFAULT_FOREGROUND_RGB, hexToRgb, hsvToRgb, normalizeColorValue, NormalizedColorValue, normalizeIndexedColorIndex, parseColor, RGBA, rgbToHex, RGBTriplet Supported Colors
Attributes and links attributesWithLink, createTextAttributes, getLinkId, detectLinks, MAX_LINK_URL_BYTES Advanced Text and terminal cells
HAST conversion HASTElement, HASTNode, HASTText, hastToStyledText Advanced Text and terminal cells
Clipboard ClipboardClearResult, ClipboardOptions, ClipboardReadOptions, ClipboardReadResult, ClipboardRepresentation, ClipboardSelection, ClipboardService, ClipboardTarget, ClipboardWriteDestination, ClipboardWriteOptions, ClipboardWriteResult, createClipboard, createHostClipboard, createRendererClipboardAdapter, HostClipboardBackend, HostClipboardClearResult, HostClipboardOperationOptions, HostClipboardOptions, HostClipboardReadOptions, HostClipboardService, HostClipboardWriteOptions, HostClipboardWriteResult, RendererClipboardBoundary, TerminalClipboardAdapter, TerminalClipboardOperationResult Supported Clipboard

Tree-sitter and syntax styles#

Area Symbols Class Canonical documentation
Client lifecycle addDefaultParsers, destroyTreeSitterClient, getTreeSitterClient, TreeSitterClient Supported Tree-sitter
File type lookup basenameToFiletype, extensionToFiletype, extToFiletype, infoStringToFiletype, pathToFiletype Supported Tree-sitter
Styled output treeSitterToStyledText, TreeSitterToStyledTextOptions, treeSitterToTextChunks Supported Tree-sitter
Parser and result types FiletypeParserOptions, HighlightMeta, HighlightRange, HighlightResponse, InjectionMapping, SimpleHighlight, TreeSitterClientEvents, TreeSitterClientOptions Supported Tree-sitter
Worker protocol BufferState, Edit, ParsedBuffer, PerformanceStats, TreeSitterWorkerLogType, TreeSitterWorkerRequest, TreeSitterWorkerResponse Advanced Tree-sitter
Syntax styles convertThemeToStyles, MergedStyle, StyleDefinition, StyleDefinitionInput, SyntaxStyle, ThemeTokenStyle Supported Tree-sitter

Plugins, console, and process services#

Area Symbols Class Canonical documentation
Generic slots createSlotRegistry, Plugin, PluginContext, PluginErrorEvent, PluginErrorPhase, PluginErrorReport, PluginErrorSource, ResolvedSlotRenderer, SlotMode, SlotRegistry, SlotRegistryOptions, SlotRenderer Supported Plugin slots
Core slots CoreManagedSlot, CorePlugin, CoreResolvedSlotRenderer, CoreSlotContribution, CoreSlotFailurePlaceholder, CoreSlotMode, CoreSlotRegistry, CoreSlotRenderer, createCoreSlotRegistry, registerCorePlugin, resolveCoreSlot, SlotRenderable, SlotRenderableOptions Supported Core plugin slots
Console overlay capture, ConsoleAction, ConsoleKeyBinding, ConsoleOptions, ConsolePosition, TerminalConsole Supported Console overlay
Environment access clearEnvCache, env, EnvVarConfig, registerEnvVar Advanced Environment variables
Environment registry output envRegistry, generateEnvColored, generateEnvMarkdown Implementation-looking public export Environment variables
Terminal palette buildTerminalPaletteSignature, createTerminalPalette, GetPaletteOptions, NormalizedTerminalPalette, normalizeTerminalPalette, OscSubscriptionSource, TerminalColors, TerminalPalette, TerminalPaletteDetector, TerminalPaletteOptions, WriteFunction Advanced Terminal capabilities
Application paths DataPaths, DataPathsEvents, DataPathsManager, getDataPaths Advanced Application data paths
Clocks Clock, SystemClock, TimerHandle Advanced Animation and Timeline

Components and component helpers#

Component or area Symbols Class Canonical documentation
ASCII font ASCIIFontName, ASCIIFontOptions, ASCIIFontRenderable, coordinateToCharacterIndex, fonts, getCharacterPositions, measureText, renderFontToFrameBuffer Supported ASCII font
Box and borders BorderCharacters, BorderCharArrays, BorderChars, borderCharsToArray, BorderConfig, BorderSides, BorderSidesConfig, BorderStyle, BoxDrawOptions, BoxOptions, BoxRenderable, getBorderFromSides, getBorderSides, isValidBorderStyle, parseBorderStyle Supported Box
Code ChunkRenderContext, CodeOptions, CodeRenderable, HighlightContext, OnChunksCallback, OnHighlightCallback Supported Code
Diff DiffRenderable, DiffRenderableOptions Supported Diff
Embedded terminal EmbeddedTerminalDataSource, EmbeddedTerminalOptions, EmbeddedTerminalRenderable, EmbeddedTerminalScreen Supported Embedded terminal
Editable buffer renderable ContentChangeEvent, CursorChangeEvent, EditBufferOptions, EditBufferRenderable, EditBufferRenderableEvents, EditorCapture, EditorTraits, isEditBufferRenderable Advanced Editing buffers and views
Frame buffer FrameBufferOptions, FrameBufferRenderable Advanced Frame buffer
Image display ImageFit, ImageRenderable, ImageRenderableOptions, ImageRenderableSource, resolveImageRenderProtocol Supported Image
Kitty transport KittyImageTransport, KittyImageTransportStatus Supported Kitty transport
Input InputAction, InputKeyBinding, InputRenderable, InputRenderableEvents, InputRenderableOptions Supported Input
Line number gutter LineColorConfig, LineNumberOptions, LineNumberRenderable, LineSign Supported Line number gutter
Markdown BlockState, createMarkdownCodeBlockRenderer, MarkdownCodeBlockRenderer, MarkdownCodeBlockRendererMap, MarkdownOptions, MarkdownRenderable, MarkdownTableOptions, MarkdownTableStyle, RenderNodeContext Supported Markdown
Markdown parser state ParseState Implementation-looking public export Markdown
Scroll bar ArrowOptions, ArrowRenderable, ScrollBarOptions, ScrollBarRenderable, ScrollUnit Advanced Scroll bar
Scroll box ScrollBoxOptions, ScrollBoxRenderable Supported Scroll box
Select SelectAction, SelectKeyBinding, SelectOption, SelectRenderable, SelectRenderableEvents, SelectRenderableOptions Supported Select
Slider SliderOptions, SliderRenderable Supported Slider
Tab select TabSelectAction, TabSelectKeyBinding, TabSelectOption, TabSelectRenderable, TabSelectRenderableEvents, TabSelectRenderableOptions Supported Tab select
Text TextOptions, TextRenderable Supported Text
Text nodes isTextNodeRenderable, RootTextNodeRenderable, TextNodeOptions, TextNodeRenderable Advanced Text and terminal cells
Text table TextTableCellContent, TextTableColumnFitter, TextTableColumnWidthMode, TextTableContent, TextTableOptions, TextTableRenderable Supported Text table
Textarea defaultTextareaKeyBindings, KeyBinding, SubmitEvent, TextareaAction, TextareaKeyAliasMap, TextareaOptions, TextareaRenderable Supported Textarea
Text buffer renderable TextBufferOptions, TextBufferRenderable Advanced Editing buffers and views
First-draw timestamp TimeToFirstDrawOptions, TimeToFirstDrawRenderable Supported Time to first draw

Buffers, editing, animation, and effects#

Area Symbols Class Canonical documentation
Cell buffer OptimizedBuffer Advanced Buffer API
Text buffer TextBuffer, TextChunk, TextBufferView Advanced Editing buffers and views
Editing EditBuffer, EditorView, Viewport Advanced Editing buffers and views
Extmarks createExtmarksController, Extmark, ExtmarkOptions, ExtmarksController Experimental, Advanced Editing buffers and views
Timeline AnimationOptions, createTimeline, getTimelineEngine, EasingFunctions, JSAnimation, Timeline, TimelineOptions Supported Animation and Timeline
Animation engine engine Implementation-looking public export Animation and Timeline
Effects CloudsEffect, CRTRollingBarEffect, DistortionEffect, FlamesEffect, RainbowTextEffect, VignetteEffect Experimental, Advanced Post-processing effects
Filters applyAsciiArt, applyBrightness, applyChromaticAberration, applyGain, applyInvert, applyNoise, applySaturation, applyScanlines, BloomEffect Experimental, Advanced Post-processing effects
Matrices ACHROMATOPSIA_MATRIX, DEUTERANOPIA_COMP_MATRIX, DEUTERANOPIA_SIM_MATRIX, GRAYSCALE_MATRIX, GREENSCALE_MATRIX, INVERT_MATRIX, PROTANOPIA_COMP_MATRIX, PROTANOPIA_SIM_MATRIX, SEPIA_MATRIX, SOLARIZATION_MATRIX, SYNTHWAVE_MATRIX, TECHNICOLOR_MATRIX, TRITANOPIA_COMP_MATRIX, TRITANOPIA_SIM_MATRIX Advanced Color matrices

Images, audio, and native span output#

Area Symbols Class Canonical documentation
NativeImage API BlendMode, CompositeOptions, ExtendOptions, ExtractOptions, ImageColorStatus, ImageError, ImageErrorCode, ImageFormat, imageInfo, ImageInfo, ImageLoadError, ImageLoadErrorCode, ImageLoadOptions, ImageSource, NativeImage, NativeImagePool, NativeImagePoolOptions, OwnedRawImage, PixelFormat, PixelImportOptions, RawImage, ResizeKernel, ResizeOptions Advanced NativeImage
Audio playback and mixing Audio, AudioAction, AudioErrorContext, AudioEvents, AudioGroup, AudioInitializationAction, AudioInitializationError, AudioPlaybackDevice, AudioPlayOptions, AudioSetupOptions, AudioSound, AudioStartOptions, AudioVoice, setupAudio Supported Audio
Streaming audio AudioStream, AudioStreamAction, AudioStreamBody, AudioStreamBodyOptions, AudioStreamBufferOptions, AudioStreamConnectContext, AudioStreamConnection, AudioStreamConnector, AudioStreamContentTypeContext, AudioStreamContentTypePolicy, AudioStreamDemuxer, AudioStreamDemuxerFactory, AudioStreamDemuxOutput, AudioStreamError, AudioStreamErrorContext, AudioStreamEvents, AudioStreamFormat, AudioStreamMetadata, AudioStreamMetadataFormat, AudioStreamOptions, AudioStreamReconnectEvent, AudioStreamReconnectOptions, AudioStreamRetryContext, AudioStreamRetryDecision, AudioStreamRetryPhase, AudioStreamSourceOptions, AudioStreamState, AudioStreamStats, AudioStreamUrlOptions, createIcyStreamDemuxer, IcyStreamDemuxerOptions Supported Streaming audio
Audio capture and recording AudioCaptureDevice, AudioCaptureOptions, AudioCaptureReadResult, AudioCaptureStats, AudioCaptureStream, AudioCaptureStreamAction, AudioCaptureStreamError, AudioCaptureStreamErrorContext, AudioCaptureStreamEvents, AudioCaptureStreamOptions, AudioCaptureStreamState, AudioCaptureStreamStats, AudioRecorder, AudioRecorderAction, AudioRecorderError, AudioRecorderErrorContext, AudioRecorderEvents, AudioRecorderState, AudioRecorderStats, AudioRecordToFileOptions Supported Audio capture and recording
Native span output DataHandler, NativeSpanFeed Advanced NativeSpanFeed

Low-level native binding exports#

These names expose the TypeScript side of the native binding. Use the higher-level API unless a low-level guide requires one of them.

Start with Native rendering for the scene model. The C and Zig guides cover their native interfaces, which are separate from npm entry points.

Area Symbols Class Canonical documentation
Standalone ownership ResourceContext, NativeResourceOwner, BufferAccess, EncodedUnicode Advanced Core resource ownership
Session driver NativeSession, NativeSessionDriverOptions, NativeSessionScheduler Advanced How Core uses native
Renderable integration NativeRenderableIntegration Advanced Custom renderables
Image ownership ImageCreateOptions Advanced NativeImage ownership
Checked errors NativeError, NativeStatus Advanced C results
Area Symbols Class Canonical documentation
Native handles and binding types AudioEngineHandle, AudioEngineLib, ClipboardOperationHandle, ClipboardServiceHandle, ContextBufferHandle, ContextEditBufferHandle, ContextEditorViewHandle, ContextEmbeddedTerminalHandle, ContextImageHandle, ContextImagePixelsHandle, ContextObjectHandle, ContextSyntaxStyleHandle, ContextTextBufferHandle, ContextTextBufferViewHandle, ContextUnicodeHandle, CursorState, EmbeddedTerminalCursor, EmbeddedTerminalKey, EmbeddedTerminalMouse, FFIRenderLib, ImageHandle, LogicalCursor, LogLevel, MeasureResult, NativeAudioStreamCloseReason, NativeAudioStreamFormat, NativeAudioStreamState, NativeBufferedOutput, NativeClipboardCancelStatus, NativeClipboardCopyStatus, NativeClipboardDestroyStatus, NativeClipboardOperationStatus, NativeClipboardShutdownStatus, NativeClipboardStartStatus, NativeContextHandle, NativeHandle, NativeSpanFeedEventHandler, NativeYogaDirtiedCallback, NativeYogaLayout, NativeYogaMeasureCallback, RenderLib, resolveRenderLib, SceneNodeHandle, SessionHandle, setRenderLibPath, VisualCursor Implementation-looking public export This section
Context and buffer bindings NATIVE_BUFFER_TEXT_BYTES_MAX, NativeBufferDraw, NativeBufferGrid, NativeBufferStack, NativeContextBufferLease, NativeContextBufferOptions, NativeContextImageDraw, NativeContextOptions, NativeDrawingTarget Implementation-looking public export This section
Scene bindings NATIVE_EDGE_NONE, NativeBorder, NativeSceneArrowOptions, NativeSceneBoxDetails, NativeSceneEditorOptions, NativeSceneFrame, NativeSceneFrameOptions, NativeSceneFrameRequest, NativeSceneHook, NativeSceneLayout, NativeScenePaint, NativeScenePaintPhase, NativeScenePaintSlot, NativeScenePaintUpdate, NativeSceneSliderOptions, NativeSceneTextMetrics, NativeSceneTextOptions, NativeSceneTextSelectionOptions Implementation-looking public export This section
Session bindings acquireSessionBufferLease, NATIVE_SESSION_CONTROL_PACKET_BYTES, NativeOutputTicket, NativeSessionBufferLease, NativeSessionCapabilities, NativeSessionControl, NativeSessionCursorOptions, NativeSessionKittyImageTransportStatus, NativeSessionOptions, NativeSessionPumpResult, NativeSessionPumpStatus, NativeSessionRendererOptions, NativeSessionRendererState, NativeSessionRenderStatus, NativeSessionSplitControl, NativeSessionState, NativeSessionTerminalOptions, NativeSessionTerminalPhase, NativeSplitSnapshot, SessionBuffer Implementation-looking public export This section
Text and editor bindings NativeContextEditBufferOptions, NativeEditBufferInfo, NativeEditCommand, NativeEditEvent, NativeEditEventName, NativeEditHighlightOperation, NativeEditorCommand, NativeEditorPositionQuery, NativeEditorReplacement, NativeEditorSelection, NativeEditorSelectionOperation, NativeEditorStyle, NativeEditorStyleMask, NativeEditorViewInfo, NativeEditorViewport, NativeEditPositionQuery, NativeEncodedStyledText, NativeTextBufferInfo, NativeTextViewCommand Implementation-looking public export This section
Native result structures AllocatorStats, AudioStreamCreateOptions, BuildOptions, GrowthPolicy, NativeAudioCaptureStats, NativeAudioStreamStats, NativeRenderStats, NativeSpanFeedOptions, NativeSpanFeedStats Advanced This section
Bundled asset resolution resolveBundledFilePath Implementation-looking public export Standalone executables
Yoga namespace Yoga Advanced Yoga API

Other @opentui/core entry points#

Testing#

@opentui/core/testing works in Bun and Node.js.

Area Symbols Class Canonical documentation
Renderer setup createTestRenderer, MockInput, MockMouse, TestExternalOutput, TestExternalOutputCommit, TestFlushOptions, TestRenderer, TestRendererOptions, TestRendererSetup, TestVisualIdleOptions, TestWaitForOptions Supported Testing
Keyboard and mouse createMockKeys, createMockMouse, KeyCodes, KeyInput, MockKeysOptions, MouseButton, MouseButtons, MouseEventOptions, MouseEventType, MouseModifiers, MousePosition, pasteBytes Supported Testing
Capabilities createTerminalCapabilities, setRendererCapabilities, TerminalCapabilitiesOverrides Supported Testing
Deterministic helpers createSpy, ManualClock, MockTreeSitterClient Supported Testing
Recording RecordedFrame, TestRecorder Supported Testing

Runtime plugin support#

These entry points are Bun-only. Their Node.js targets are stubs that throw during import.

Package entry point Symbols Class Canonical documentation
@opentui/core/runtime-plugin createRuntimePlugin, CreateRuntimePluginOptions, isCoreRuntimeModuleSpecifier, RuntimeModuleEntry, RuntimeModuleExports, runtimeModuleIdForSpecifier, RuntimeModuleLoader, RuntimePluginRewriteOptions, RuntimeSpecifierPreserve Runtime-specific, Advanced Runtime module loading
@opentui/core/runtime-plugin-support createRuntimePlugin, CreateRuntimePluginOptions, ensureRuntimePluginSupport, RuntimeModuleEntry, RuntimeModuleExports, runtimeModuleIdForSpecifier, RuntimeModuleLoader, RuntimeSpecifierPreserve Runtime-specific, Advanced Runtime module loading
@opentui/core/runtime-plugin-support/configure createRuntimePlugin, CreateRuntimePluginOptions, ensureRuntimePluginSupport, RuntimeModuleEntry, RuntimeModuleExports, runtimeModuleIdForSpecifier, RuntimeModuleLoader, RuntimeSpecifierPreserve Runtime-specific, Advanced Runtime module loading

Yoga#

@opentui/core/yoga works in Bun and Node.js. The root Yoga namespace exposes this module. See Yoga API for methods and ownership.

Purpose Symbols Class
Objects and callback types Config, Node, default, DirtiedFunction, Layout, MeasureFunction, Size, Value Advanced
Errors YogaError, YogaStatus Advanced
Alignment Align, ALIGN_AUTO, ALIGN_BASELINE, ALIGN_CENTER, ALIGN_FLEX_END, ALIGN_FLEX_START, ALIGN_SPACE_AROUND, ALIGN_SPACE_BETWEEN, ALIGN_SPACE_EVENLY, ALIGN_STRETCH Advanced
Box sizing BoxSizing, BOX_SIZING_BORDER_BOX, BOX_SIZING_CONTENT_BOX Advanced
Dimensions Dimension, DIMENSION_HEIGHT, DIMENSION_WIDTH Advanced
Direction Direction, DIRECTION_INHERIT, DIRECTION_LTR, DIRECTION_RTL Advanced
Display Display, DISPLAY_CONTENTS, DISPLAY_FLEX, DISPLAY_NONE Advanced
Edges Edge, EDGE_ALL, EDGE_BOTTOM, EDGE_END, EDGE_HORIZONTAL, EDGE_LEFT, EDGE_RIGHT, EDGE_START, EDGE_TOP, EDGE_VERTICAL Advanced
Compatibility errata Errata, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING, ERRATA_ALL, ERRATA_CLASSIC, ERRATA_NONE, ERRATA_STRETCH_FLEX_BASIS Advanced
Experimental feature ExperimentalFeature, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS Experimental, Advanced
Flex direction FlexDirection, FLEX_DIRECTION_COLUMN, FLEX_DIRECTION_COLUMN_REVERSE, FLEX_DIRECTION_ROW, FLEX_DIRECTION_ROW_REVERSE Advanced
Gaps Gutter, GUTTER_ALL, GUTTER_COLUMN, GUTTER_ROW Advanced
Justification Justify, JUSTIFY_CENTER, JUSTIFY_FLEX_END, JUSTIFY_FLEX_START, JUSTIFY_SPACE_AROUND, JUSTIFY_SPACE_BETWEEN, JUSTIFY_SPACE_EVENLY Advanced
Logging LogLevel, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_VERBOSE, LOG_LEVEL_WARN Advanced
Measurement MeasureMode, MEASURE_MODE_AT_MOST, MEASURE_MODE_EXACTLY, MEASURE_MODE_UNDEFINED Advanced
Node type NodeType, NODE_TYPE_DEFAULT, NODE_TYPE_TEXT Advanced
Overflow Overflow, OVERFLOW_HIDDEN, OVERFLOW_SCROLL, OVERFLOW_VISIBLE Advanced
Position PositionType, POSITION_TYPE_ABSOLUTE, POSITION_TYPE_RELATIVE, POSITION_TYPE_STATIC Advanced
Units Unit, UNIT_AUTO, UNIT_PERCENT, UNIT_POINT, UNIT_UNDEFINED Advanced
Wrapping Wrap, WRAP_NO_WRAP, WRAP_WRAP, WRAP_WRAP_REVERSE Advanced

Tree-sitter assets, worker, and Node assets#

Package entry point Runtime Symbols Class Canonical documentation
@opentui/core/tree-sitter/update-assets Build time, with Bun CLI runUpdateAssetsCli, updateAssets, UpdateOptions Runtime-specific Tree-sitter
@opentui/core/parser.worker Bun and Node.js worker No named application exports Implementation-looking public export Tree-sitter
@opentui/core/node-assets Node.js build time getNodeAssets, NodeAsset, NodeAssetTarget Runtime-specific Standalone executables

@opentui/react#

The root and compiler-selected JSX entry points work in Bun and Node.js.

Root exports#

Area Symbols Class Canonical documentation
Root rendering createElement, createPortal, createRoot, flushSync, Root Supported React bindings
Application context AppContext, useAppContext Supported React bindings
Hooks useBlur, useFocus, useKeyboard, UseKeyboardOptions, useOnResize, usePaste, useRenderer, useSelectionHandler, useTerminalDimensions, useTimeline Supported React bindings
Catalogue extension extend, ExtendedComponentProps, ExtendedIntrinsicElements, getComponentCatalogue, OpenTUIComponents, RenderableConstructor Advanced React bindings
Catalogue objects baseComponents, componentCatalogue Implementation-looking public export React bindings
Component prop types AsciiFontProps, BoxProps, CodeProps, DiffProps, GetNonStyledProperties, ImageProps, InputProps, LineBreakProps, LineNumberProps, LinkProps, MarkdownProps, NonStyledProps, ReactProps, ScrollBoxProps, SelectProps, SpanProps, TabSelectProps, TextareaProps, TextProps Supported Components overview
Plugin slots createReactSlotRegistry, createSlot, ReactBoundSlotProps, ReactPlugin, ReactRegistrySlotComponent, ReactSlotComponent, ReactSlotOptions, ReactSlotProps, Slot, SlotMode Supported React plugin slots
First-draw timestamp TimeToFirstDraw, TimeToFirstDrawProps Supported Time to first draw

Other React entry points#

Package entry point Symbols Class Canonical documentation
@opentui/react/renderer declarations createPortal, createRoot, flushSync, Root Supported React bindings
@opentui/react/renderer runtime All runtime values from @opentui/react Implementation-looking public export React bindings
@opentui/react/test-utils testRender Supported Testing
@opentui/react/runtime-plugin-support ensureRuntimePluginSupport, ReactRuntimePluginSupportOptions Runtime-specific, Advanced Runtime module loading
@opentui/react/runtime-plugin-support/configure ensureRuntimePluginSupport, ReactRuntimePluginSupportOptions Runtime-specific, Advanced Runtime module loading
@opentui/react/jsx-runtime Fragment, jsx, jsxs, JSX Supported React bindings
@opentui/react/jsx-dev-runtime Fragment, jsxDEV, JSX Supported React bindings

The generated React map points /renderer runtime imports to index.js. Its declaration path points to reconciler/renderer.d.ts. Treat root values outside the four declared names as a build leak.

@opentui/solid#

The root, /components, and compiler-selected JSX entry points work in Bun and Node.js.

Root exports#

Area Symbols Class Canonical documentation
Root rendering render, testRender Supported Solid bindings
Hooks onBlur, onFocus, onResize, useKeyboard, UseKeyboardOptions, usePaste, useRenderer, useSelectionHandler, useTerminalDimensions, useTimeline Supported Solid bindings
Renamed hook useKeyHandler Deprecated Use useKeyboard in Solid bindings.
Components createDynamic, Dynamic, DynamicProps, Portal Supported Solid bindings
Scrollback createScrollbackWriter, SolidScrollbackNode, SolidScrollbackWriterOptions, writeSolidToScrollback Advanced Renderer
Catalogue extension extend, ExtendedComponentProps, ExtendedIntrinsicElements, getComponentCatalogue, OpenTUIComponents, RenderableConstructor Advanced Solid bindings
Catalogue and text wrappers baseComponents, BoldSpanRenderable, componentCatalogue, ItalicSpanRenderable, LineBreakRenderable, LinkOptions, LinkRenderable, TextNodeKey, textNodeKeys, UnderlineSpanRenderable Implementation-looking public export Solid bindings
Reconciler _render, createComponent, createElement, createSlotNode, createTextNode, DomNode, effect, insert, insertNode, memo, mergeProps, removeNode, setProp, spread, use Implementation-looking public export Solid bindings
Reconciler context and wrappers LayoutSlotRenderable, RenderableContext, RendererContext, SlotRenderable, TextSlotRenderable Implementation-looking public export Solid bindings
Component prop types AsciiFontProps, BoxProps, CodeProps, ElementProps, GetNonStyledProperties, ImageProps, InputProps, LinkProps, MarkdownProps, NonStyledProps, ScrollBoxProps, SelectProps, SpanProps, TabSelectProps, TextareaProps, TextProps Supported Components overview
Plugin slots createSlot, createSolidSlotRegistry, Slot, SlotMode, SolidBoundSlotProps, SolidPlugin, SolidRegistrySlotComponent, SolidSlotComponent, SolidSlotOptions, SolidSlotProps Supported Solid plugin slots
JSX namespace JSX Supported Solid bindings
First-draw timestamp TimeToFirstDraw, TimeToFirstDrawProps Supported Time to first draw

Other Solid entry points#

Package entry point Symbols Class Canonical documentation
@opentui/solid/preload No named exports. Importing it installs the Bun source transform. Runtime-specific Solid bindings
@opentui/solid/bun-plugin createSolidTransformPlugin, CreateSolidTransformPluginOptions, default, ensureSolidTransformPlugin, resetSolidTransformPluginState Runtime-specific, Advanced Solid bindings
@opentui/solid/runtime-plugin-support ensureRuntimePluginSupport, SolidRuntimePluginSupportOptions Runtime-specific, Advanced Runtime module loading
@opentui/solid/runtime-plugin-support/configure ensureRuntimePluginSupport, SolidRuntimePluginSupportOptions Runtime-specific, Advanced Runtime module loading
@opentui/solid/components extend, ExtendedComponentProps, ExtendedIntrinsicElements, getComponentCatalogue, OpenTUIComponents Advanced Solid bindings
@opentui/solid/jsx-runtime Fragment, jsx, jsxDEV, jsxs, JSX Supported Solid bindings
@opentui/solid/jsx-dev-runtime Fragment, jsxDEV, JSX Supported Solid bindings

@opentui/keymap#

Root engine#

The root engine is host-agnostic. Use an adapter entry point to connect it to a browser or OpenTUI renderer.

Kind Symbols Class Canonical documentation
Values Keymap, KEYMAP_EXTENSION_CONTEXT, stringifyKeySequence, stringifyKeyStroke Supported Core keymap API
Types ActiveBinding, ActiveKey, ActiveKeyOptions, Attributes, Binding, BindingCommand, BindingEvent, BindingExpander, BindingExpanderContext, BindingExpansion, BindingFieldCompiler, BindingFieldContext, BindingParser, BindingParserContext, BindingParserResult, Bindings, BindingsValidationResult, BindingTransformer, BindingTransformerContext, Command, CommandBindingsQuery, CommandContext, CommandEntry, CommandFieldCompiler, CommandFieldContext, CommandFilter, CommandHandler, CommandQuery, CommandQueryValue, CommandResolver, CommandResolverContext, CommandResult, CommandTransformer, CommandTransformerContext, DispatchBinding, DispatchEvent, DispatchLayer, DispatchPhase, ErrorEvent, EventData, EventMatchResolver, EventMatchResolverContext, EventName, Events, HostCapability, HostMetadata, HostModifier, HostPlatform, InterceptName, Intercepts, KeyAfterInputContext, KeyAfterReason, KeyDeferredDisambiguationContext, KeyDeferredDisambiguationDecision, KeyDeferredDisambiguationHandler, KeyDisambiguationContext, KeyDisambiguationDecision, KeyDisambiguationResolver, KeyInputContext, KeyInterceptOptions, KeyLike, KeymapEvent, KeymapExtensionContext, KeymapExtensionProvider, KeymapHost, KeyMatch, KeySequencePart, KeyStringifyInput, KeyStrokeInput, KeyToken, Layer, LayerAnalysisContext, LayerAnalyzer, LayerBindingAnalysis, LayerBindingsTransformer, LayerBindingsTransformerContext, LayerFieldCompiler, LayerFieldContext, Listener, NormalizedKeyStroke, ParsedBinding, ParsedCommand, RawInputContext, RawInterceptOptions, ReactiveMatcher, ResolvedKeyToken, ResolvedSequencePattern, RunCommandOptions, RunCommandResult, SequencePattern, SequencePatternMatch, StringifyOptions, TargetMode, WarningEvent Supported Core keymap API

Extras and graph#

Package entry point Symbols Class Canonical documentation
@opentui/keymap/extras BindingCommandMap, BindingConfig, BindingConfigItem, BindingDefaults, BindingDefaultsContext, BindingLookup, BindingValue, CommandBindingMap, commandBindings, CommandBindingsError, CommandBindingsOptions, CommandBindingsOverrideWarning, createBindingLookup, CreateBindingLookupOptions, formatCommandBindings, FormatCommandBindingsOptions, formatKeySequence, FormatKeySequenceOptions, KeyModifierName, KeySequenceFormatPart, SequenceBindingLike, TokenDisplayResolver Supported Core keymap API
@opentui/keymap/extras/graph createGraphExtra, getGraphSnapshot, GraphBinding, GraphCommand, GraphInactiveReason, GraphLayer, GraphSequenceNode, GraphSnapshot, GraphSnapshotOptions, KeymapGraphExtra Advanced Core keymap API

Addons#

Package entry point Symbols Class Canonical documentation
@opentui/keymap/addons Aliases, BackspacePopsPendingSequenceOptions, defaultBindingParser, defaultEventMatchResolver, Enabled, EscapeClearsPendingSequenceOptions, ExCommand, ExCommandPayload, LeaderOptions, LeaderTrigger, NeovimDisambiguationOptions, registerAliasesField, registerBackspacePopsPendingSequence, registerBindingOverrides, registerCommaBindings, registerDeadBindingWarnings, registerDefaultBindingParser, registerDefaultEventMatchResolver, registerDefaultKeys, registerEmacsBindings, registerEnabledFields, registerEscapeClearsPendingSequence, registerExCommands, registerLeader, registerMetadataFields, registerModBindings, registerNeovimDisambiguation, registerTimedLeader, registerUnresolvedCommandWarnings, TimedLeaderOptions Supported Built-in keymap addons
@opentui/keymap/addons/opentui Every export from @opentui/keymap/addons, plus createTextareaBindings, EditBufferCommandName, EditBufferCommandOptions, EditBufferFineGroup, registerBaseLayoutFallback, registerEditBufferCommands, registerManagedTextareaLayer, registerTextareaMappingSuspension Supported Built-in keymap addons and Custom keymap addons

Testing and hosts#

Package entry point Runtime Symbols Class Canonical documentation
@opentui/keymap/testing JavaScript test runtimes captureKeymapDiagnostics, createTestHostMetadata, createTestKeymap, createTestKeymapHost, CreateTestKeymapHostOptions, CreateTestKeymapOptions, DEFAULT_TEST_HOST_METADATA, TestDiagnosticCapture, TestHostMetadataOptions, TestKeymapEvent, TestKeymapHarness, TestKeymapHost, TestKeymapTarget, TestKeyModifierOptions Supported Core keymap API
@opentui/keymap/html Browser DOM createDefaultHtmlKeymap, createHtmlKeymap, createHtmlKeymapEvent, createHtmlKeymapHost, htmlEventMatchResolver, HtmlKeymapEvent, normalizeHtmlKeyName Runtime-specific Keymap hosts
@opentui/keymap/opentui Bun and Node.js createDefaultOpenTuiKeymap, createOpenTuiKeymap, createOpenTuiKeymapHost Runtime-specific Keymap hosts

Frameworks and runtime modules#

Package entry point Symbols Class Canonical documentation
@opentui/keymap/react KeymapProvider, KeymapProviderProps, reactiveMatcherFromStore, useActiveKeys, useBindings, UseBindingsLayer, UseBindingsTargetRef, useKeymap, usePendingSequence Runtime-specific React keymap integration
@opentui/keymap/solid KeymapProvider, KeymapProviderProps, reactiveMatcherFromSignal, useBindings, UseBindingsLayer, UseBindingsTarget, useKeymap, useKeymapSelector Runtime-specific Solid keymap integration
@opentui/keymap/runtime-modules runtimeModules Runtime-specific, Advanced Runtime module loading

The runtimeModules map contains the root, both extras paths, both addon paths, and both host adapters. It loads the React and Solid paths lazily. It does not contain /testing or /runtime-modules.

@opentui/qrcode#

The package root works in Bun and Node.js. Each framework path re-exports the full root and adds its registration function.

Package entry point Symbols Class Canonical documentation
@opentui/qrcode ByteEncoding, createQrSvg, EciAssignment, EncodeOptions, encodeTextBytes, ErrorCorrectionLevel, Fnc1SecondPositionInfo, Gs1Element, QRCode, QRCodeFitMode, QRCodeOptions, QRCodeRenderable, QrSegment, StructuredAppendInfo, TerminalRenderOptions Supported QR encoder and QR code component
@opentui/qrcode/react Every root export, plus registerQRCode Runtime-specific QR code component
@opentui/qrcode/solid Every root export, plus registerQRCode Runtime-specific QR code component

@opentui/ssh#

The package supports Bun 1.3.14 or later and Node.js 26.4.0 or later. Use Bun 1.4.0 or later on native Windows arm64. It has one public entry point.

Symbols Class Canonical documentation
AuthConfig, AuthMethods, ConfigError, createServer, DenyError, Handoff, Identity, IdentityFor, ListenInfo, LogEvent, logging, LoggingOptions, Middleware, MiddlewareFunction, MiddlewareSession, Next, OutputPressureError, PublicKey, PublicKeyPolicy, RemoteAddress, Server, ServerBuilder, ServerConfig, Session, SessionHandler, SshError Runtime-specific SSH

@opentui/three#

Both entry points are Bun-only.

Package entry point Symbols Class Canonical documentation
@opentui/three AnimationDefinition, AnimationStateConfig, CLICanvas, DEFAULT_EXPLOSION_PARAMETERS, DEFAULT_PHYSICS_EXPLOSION_PARAMETERS, ExplodingSpriteEffect, ExplosionCreationData, ExplosionEffectParameters, ExplosionHandle, ExplosionManager, InstanceManager, InstanceManagerOptions, MeshPool, MeshPoolOptions, ParticleEffectParameters, PhysicsExplodingSpriteEffect, PhysicsExplosionCreationData, PhysicsExplosionEffectParameters, PhysicsExplosionHandle, PhysicsExplosionManager, PhysicsSpriteRecreationData, PlanckPhysicsWorld, PlanckRigidBody, RapierPhysicsWorld, RapierRigidBody, ResolvedAnimationState, ResourceConfig, SheetProperties, SheetSprite, SpriteAnimator, SpriteDefinition, SpriteParticleGenerator, SpriteRecreationData, SpriteResource, SpriteResourceManager, SpriteUtils, SuperSampleAlgorithm, SuperSampleType, TextureUtils, THREE, ThreeCliRenderer, ThreeCliRendererOptions, ThreeRenderable, ThreeRenderableOptions, TiledSprite Runtime-specific, Advanced Three.js WebGPU
@opentui/three/runtime-modules runtimeModules Runtime-specific, Advanced Runtime module loading

The THREE namespace exposes the installed Three.js module. The runtimeModules map contains only the @opentui/three root.

Native distribution packages#

The build generates eight platform packages:

  • @opentui/core-darwin-x64
  • @opentui/core-darwin-arm64
  • @opentui/core-linux-x64
  • @opentui/core-linux-arm64
  • @opentui/core-linux-x64-musl
  • @opentui/core-linux-arm64-musl
  • @opentui/core-win32-x64
  • @opentui/core-win32-arm64

Each package has one default export that resolves the native library path. These packages are internal distribution surfaces, not application APIs. Let @opentui/core select the correct package. See Runtime and platform support.

opentui.h#

The npm API and the native application binary interface (ABI) are separate surfaces. opentui.h declares the experimental C ABI. See C. The C ABI reference lists every declaration with the release that added it.

OpenTUI’s TypeScript packages call the native library through internal bindings that can change with them. Use the TypeScript exports indexed above for application code.

These rows name the declarations that the native guides document. The comments in opentui.h document every declaration.

Area Symbols Canonical documentation
ABI version OT_CONTEXT_ABI_VERSION Build the library
Contexts ot_context, ot_context_create, ot_context_destroy, ot_context_options Group resources in a Context
Handles ot_handle A handle names an object
Results ot_status, OT_OK, OT_INVALID_ARGUMENT, OT_UNSUPPORTED_VERSION, OT_WRONG_CONTEXT, OT_WRONG_SESSION, OT_WRONG_KIND, OT_STALE_HANDLE, OT_WRONG_THREAD, OT_CONTEXT_BUSY, OT_FRAME_BUSY, OT_OUTPUT_BACKPRESSURE, OT_STALE_FRAME, OT_STALE_OUTPUT, OT_STALE_LEASE Initialize records and check results
Sessions ot_session_create, ot_session_options, ot_session_attach_renderer, ot_session_renderer_options, ot_session_setup_terminal, OT_INVALID_PHASE Add a Session for output
Shared resources ot_buffer_create, ot_text_buffer_create, ot_text_buffer_view_create, ot_edit_buffer_create, ot_editor_view_create, ot_syntax_style_create, ot_scene_set_text_view, OT_SCENE_TEXT_VIEW Create shared resources in one Context
Images ot_image_decode, ot_image_inspect, ot_image_create_pixels, ot_image_take_pixels, ot_image_pixels_release, ot_image_clone, ot_image_retain Create images in a Context
Buffer leases ot_buffer_acquire_lease, ot_buffer_lease_validate, ot_buffer_lease_get_real_char_size, ot_buffer_lease_write_resolved_chars, ot_buffer_lease_release Borrow cells for one synchronous operation
Owned buffers ot_scene_set_surface, ot_scene_frame_draw_buffer, ot_session_draw_buffer, OT_SCENE_CUSTOM Compose an owned buffer
Text and geometry ot_scene_get_layout, ot_scene_set_styled_text, ot_styled_text_chunk, ot_scene_text_info, OT_LAYOUT_PUBLIC, OT_LAYOUT_YOGA, OT_LAYOUT_PAINT Read text and geometry
Teardown ot_scene_destroy_node, ot_session_cancel, ot_session_close, ot_session_destroy, OT_CLIPBOARD_START_SHUTTING_DOWN Finish work before destroying owners
Scene nodes ot_scene_create_node, ot_scene_move_node, ot_scene_set_paint, ot_scene_paint_options, ot_scene_set_text, OT_SCENE_ROOT, OT_SCENE_BOX, OT_SCENE_TEXT Add the box and label
Host drawing ot_buffer_draw_text_record, ot_scene_record_draw, ot_scene_record_slot, OT_BUFFER_DRAW_TEXT, OT_SCENE_RECORD_DRAW, OT_SCENE_RECORD_SLOT, OT_SCENE_RECORD_PHASE_AFTER Add host drawing
Paint and deliver ot_scene_paint, ot_scene_frame_request, ot_scene_frame_commit, ot_session_complete_output, OT_UNSUPPORTED_RESOURCE Paint, submit, and deliver
Frame requests ot_scene_frame_step_with_geometry, ot_scene_frame_geometry, ot_scene_frame_options, ot_scene_set_hooks, ot_scene_hooks, OT_SCENE_FRAME_DONE, OT_SCENE_FRAME_UPDATE, OT_SCENE_FRAME_RESIZE, OT_SCENE_FRAME_LAYOUT_CHANGED, OT_SCENE_FRAME_RECORD, OT_SCENE_FRAME_YIELD, OT_SCENE_HOOK_UPDATE, OT_SCENE_HOOK_RESIZE, OT_SCENE_HOOK_LAYOUT_CHANGED Read and acknowledge requests
Paint hooks ot_scene_frame_get_paint_slots, ot_scene_paint_slot, ot_scene_record_header, ot_scene_hit_test, ot_scene_set_image, OT_SCENE_HOOK_RENDER_BEFORE, OT_SCENE_HOOK_RENDER_SELF, OT_SCENE_HOOK_RENDER_AFTER, OT_SCENE_RECORD_BYTES_MAX, OT_BUFFER_DRAW_CLEAR Record paint hooks
Measurement ot_scene_set_measure, ot_scene_measure_callback Measure custom content
Property updates ot_scene_flush, OT_SCENE_PROPERTY_STYLE, OT_SCENE_MUTATIONS_MAX, OT_SCENE_PROPERTY_BYTES_MAX Submit property updates
Changes during a frame ot_scene_frame_cancel, ot_scene_set_viewport, OT_FRAME_REQUEST_LIMIT, OT_LAYOUT_LIMIT Change the scene during a frame
Framebuffer access ot_scene_frame_acquire_buffer_lease, ot_session_acquire_buffer_lease Access the framebuffer
Rendering and output ot_session_render, ot_session_render_split, ot_session_read_output, ot_session_drain_output, ot_session_drain_stdout, ot_output_ticket, OT_RENDER_PRESENTED, OT_RENDER_PENDING, OT_RENDER_SKIPPED, OT_RENDER_FAILED Commit the draft, then complete output
Output storage ot_session_get_write_limit, OT_SESSION_CONTROL_PACKET_BYTES Reserve output storage
Terminal work ot_session_pump, ot_session_control, OT_PUMP_IDLE, OT_PUMP_AGAIN, OT_PUMP_WAIT_UNTIL, OT_PUMP_OUTPUT_PENDING, OT_PUMP_CLOSED, OT_CONTROL_CAPABILITY_RESPONSE Pump terminal work and close
Host output OT_OUTPUT_BUSY, OT_OUTPUT_FAILED Output without a host copy
Deadlines ot_session_pump_exit, ot_session_poll_kitty_image_transport One Session deadline clock
Core integration ot_context_set_edit_event_callback, ot_edit_event_callback, OT_BUFFER_TEXT_BYTES_MAX How Core uses native

Changes since 0.5.14#

Layout, hit testing, and painting now run in a native scene. Native resources belong to an owner Context. This section lists each 0.5.14 API and behavior that was removed or changed, and what to use instead. Each item names the changed API or behavior first. New APIs are in the tables above.

Renderer#

  • addToHitGrid(), pushHitGridScissorRect(), popHitGridScissorRect(), and clearHitGridScissorRects(): removed from the renderer and RenderContext. Native code adds a hit area for each visible node and clips it to overflow ancestors. Use renderer.hitTest(x, y) to query the hit grid.
  • dumpBuffers() and dumpOutputBuffer(): removed. Use test frame capture, renderer.currentRenderBuffer.withBuffers(), or a custom stdout. dumpHitGrid() remains.
  • renderer.useThread and the useThread option of createCliRenderer() and createTestRenderer(): removed. Core writes output on the JavaScript thread. Remove the option.
  • renderer.rendererPtr: removed, with no replacement.
  • OTUI_NO_NATIVE_RENDER environment variable: removed. Use createTestRenderer().
  • suspend() and resume(): now return a Promise<void>. Await them. They throw when the terminal is not set up (also after destroy()) or a transition is pending. resume() also throws when the renderer is not suspended.
  • useMouse, enableKittyKeyboard(), and disableKittyKeyboard(): now throw during terminal setup, suspend, or resume, and while the renderer is suspended. screenMode now throws during setup, suspend, or resume. Change them after the transition completes.
  • enableKittyKeyboard(flags): now throws RangeError when flags is not an integer from 0 to 31.
  • Output stream error event: now closes the renderer and rejects renderer.closed. Handle the rejection of closed. In 0.5.14, the renderer handled the event only while Kitty file transport was active. It cancelled file transport and kept running. A failed Kitty temporary-file write still falls back to inline transport.
  • Renderer methods after destroy(): setTerminalTitle(), resetTerminalBgColor(), copyToClipboardOSC52(), clearClipboardOSC52(), isOsc52Supported(), setCursorPosition(), setCursorStyle(), setCursorColor(), setMousePointer(), getCursorState(), getStats(), getNativeStats(), configureDebugOverlay(), toggleDebugOverlay(), dumpHitGrid(), hitTest(), and console.show() (also through console.toggle()) throw. getPalette() rejects. requestRender(), resize(), triggerNotification(), and getLinkAt() do nothing. Check renderer.isDestroyed first.
  • getPalette(): now rejects before the terminal is set up, for example on a createTestRenderer() renderer. It also rejects while a setup, suspend, or resume is pending. Its size must be an integer from 1 to 256.
  • Renderable constructors and engine.attach(): now throw for a destroyed renderer. Create renderables before you destroy the renderer.
  • destroy(): restores the terminal and releases the streams asynchronously. Await renderer.closed before you reuse the streams.
  • Scrollback snapshots and commits: one snapshot or commit larger than the output capacity divided by 24 bytes (about 349,000 cells by default) throws. A rowColumns value that is not an integer from 0 to the snapshot width throws RangeError. In 0.5.14, Core truncated and clamped rowColumns.

Renderables and layout#

  • RootRenderable.calculateLayout(): removed. Layout runs in the native frame step. Read getLayout() after renderOnce() or await renderer.idle().
  • Renderable.getLayoutNode() and the protected yogaNode: removed. Use layout properties, setMeasureProvider(), invalidateIntrinsicSize(), and getLayout(). Renderables cannot use Display.Contents. The standalone Yoga API remains.
  • render(), updateLayout(), updateFromLayout(), canReuseRenderCommandList(), and the RenderCommand type: removed. Override renderSelf(buffer, deltaTime), or use the renderBefore and renderAfter paint hooks. In a subclass of TextBufferRenderable or EditBufferRenderable, the override has one parameter: renderSelf(buffer).
  • Protected _x, _y, _widthValue, _heightValue, _childrenInZIndexOrder, _getVisibleChildren(), _hasVisibleChildFilter(), and getScissorRect(): removed. Use x, y, width, height, screenX, and screenY. For child culling, use the viewportCulling option of ScrollBox.
  • Protected renderCursor() of edit buffer renderables: removed. Use the cursor options.
  • Protected updateViewportOffset(): TextRenderable no longer calls it when it scrolls or resizes. Native code applies the viewport.
  • Protected color fields of ASCIIFontRenderable: now hold RGBA values.
  • Custom RenderContext: must now implement nativeScene, requestAnimationFrame(), and cancelAnimationFrame().
  • Paint hooks (renderBefore, renderSelf, and renderAfter): now receive a recording buffer. buffers, withBuffers(), getRealCharBytes(), and getSpanLines() throw in a hook. Draw into a buffer that you own and compose it, or use a post-process function. A buffered: true custom renderable is different: its hooks receive its own frame buffer.
  • Changes made in a paint hook: a layout, position, visibility, child, or zIndex change takes effect in the next frame. Color and text changes paint in the same frame.
  • on("resized") and on("layout-changed"): now throw on a renderable that is not the root. These listeners never ran in 0.5.14. Use onSizeChange.
  • Geometry after destroy(): x, y, screenX, screenY, width, and height of a renderable that is not selectable return 0 or the styled size, not the last layout. Read them before you destroy the renderable.
  • RenderContext.getLifecyclePasses(): now contains only renderables whose lifecycle pass is active.
  • Box customBorderChars: wide, combining, or control characters now throw.

Buffers#

  • OptimizedBuffer.create(width, height, widthMethod, options): now requires options.owner. Pass renderer.nativeScene or a ResourceContext.
  • buffer.buffers: works only in a post-process function. Use buffer.withBuffers(callback) elsewhere.
  • Drawing into renderer.nextRenderBuffer: works only in a post-process function. renderer.currentRenderBuffer does not accept drawing. In 0.5.14, frame callbacks could draw into nextRenderBuffer, for example with ThreeCliRenderer.drawScene(). Draw into a FrameBufferRenderable instead.
  • encodeUnicode(text): now returns { data } and never null. Its char values are opaque tokens for drawChar() on a buffer with the same owner. A tab encodes as two one-cell spaces.
  • buffer.ptr and getNativeId(): removed. Keep the buffer object. buffer.id is only a label.
  • Drawing methods: now throw RangeError for fractional, NaN, or infinite coordinates and sizes. Round them first.
  • drawText() and box titles: now throw RangeError for text larger than 64 KiB of UTF-8.
  • pushOpacity() and color-matrix strength: a non-finite value now throws.
  • Composing a buffer into itself now throws. setRespectAlpha() on a renderer buffer throws.
  • setCell(), setCellWithAlphaBlending(), drawChar(), and drawText(): now reject attribute bits 8 to 31. Pass only text attributes. Use the styled-text link() helper for hyperlinks.

Text and editing#

  • SyntaxStyle.create(), fromStyles(styles), and fromTheme(theme): now create(owner), fromStyles(styles, owner), and fromTheme(theme, owner). Pass renderer.nativeScene, or a ResourceContext for standalone use.
  • TextBuffer.create(widthMethod) and EditBuffer.create(widthMethod): now create(widthMethod, owner).
  • .ptr on TextBuffer, TextBufferView, EditBuffer, EditorView, and SyntaxStyle: removed. Their constructors take Context handles. Use the create() factories.
  • EditBuffer.setText(), insertText(), and replaceText(), the same Textarea and Input methods, Textarea initialValue, Input.value, and the placeholder of both: now throw for control characters other than tab, carriage return, and line feed. Remove them first. Paste handlers remove them.
  • TextBuffer.loadFile(): now rejects invalid UTF-8.
  • Text buffer and text view offsets: must be integers. Other values throw RangeError.
  • Highlight priority above 255 or hlRef above 65535: now throws. In 0.5.14, the value wrapped.
  • Color getters of text, text table, ASCII font, Markdown, Diff, line number, and QR code renderables, and the SyntaxStyle style getters: now return copies. Change a color through its setter. ASCIIFont.color returns an RGBA.

Resources and native bindings#

  • Minimum Bun version: now 1.3.14 (was 1.3.0), the tested minimum. Bun 1.3.0 to 1.3.3 convert some FFI pointer arguments to wrong addresses. Bun 1.3.4 to 1.3.6 can crash after a Worker exits. Bun 1.3.7 intermittently hangs while it loads modules.
  • Clipboard class: removed. Use renderer.copyToClipboardOSC52() and clearClipboardOSC52(), or createClipboard() with createHostClipboard() and createRendererClipboardAdapter(renderer).
  • Native resources: each resource now belongs to one owner Context. Resources from different owners cannot be used together. Drawing a NativeImage into a renderer copies it into the renderer’s Context.
  • Images that ImageRenderable loads: belong to the renderer’s Context and throw after renderer.destroy(). To keep an image, load it yourself, for example with NativeImage.load(), and pass it as source.
  • getAllocatorStats(): does not count Context memory. getArenaAllocatedBytes() always returns 0. Use process.memoryUsage().rss for total memory.
  • Handle types RendererHandle, OptimizedBufferHandle, TextBufferHandle, TextBufferViewHandle, EditBufferHandle, EditorViewHandle, SyntaxStyleHandle, EventSinkHandle, NativeRenderableHandle, EmbeddedTerminalHandle, NativeMeasureTargetHandle, NativeMeasureTargetKind, NativeRenderOperationResult, and NativeRendererCreateOptions: removed. Use the Context*Handle types, SessionHandle, and SceneNodeHandle. ImageHandle is now an alias of ContextImageHandle.
  • Pointer-based RenderLib methods, such as createRenderer, createOptimizedBuffer, bufferDrawText, setUseThread, and nativeRenderableSetMeasureTarget: removed. Use the public classes. Standalone Yoga nodes measure only with JavaScript measure functions.
  • Standalone Yoga: Config.free() now throws while nodes from that config remain. Invalid arguments, such as an out-of-range child index or enum value, throw YogaError. Measure and dirtied functions must return synchronously and must not change Yoga nodes. See Yoga API.

SSH#

  • @opentui/ssh session.write(): can now throw OutputPressureError or RangeError. cols and rows hold the requested size until the renderer attaches. onClose runs at logical close, before the renderer finishes closing.

Native libraries#

  • Legacy native exports, such as createRenderer and bufferDrawText: removed. Use the ot_* C ABI in opentui.h. See C.
  • Zig GraphemePool.alloc(), GraphemePool.allocUnowned(), and LinkPool.alloc(): replaced by acquire(). It copies the bytes and returns an ID that holds one reference. Call decref() to release it. alloc() returned an ID with no references, and allocUnowned() did not copy.
  • Zig GraphemePool.freeUnreferenced() and the global pools (initGlobalPool(), initGlobalPoolWithOptions(), deinitGlobalPool(), initGlobalLinkPool(), and deinitGlobalLinkPool()): removed. Use explicit pools or opentui.Context. See Zig.
  • Zig UnifiedTextBuffer.setStyledText() and StyledChunk: removed. Use replaceOwnedStyledText() with OwnedStyledChunk. clear() and reset() can now return errors.
  • Zig CliRenderer.dumpBuffers() and dumpOutputBuffer(): removed.