These docs describe the main branch, including unreleased changes. Read the 0.8.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

ClassMeaning
SupportedThis is a normal supported API.
AdvancedThis API needs direct ownership, lifecycle, rendering, or integration knowledge.
ExperimentalThis API can change as its design develops.
Runtime-specificThis API works only in the runtime shown in its row.
DeprecatedKeep this API only while you move to its replacement.
Implementation-looking public exportThe 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 pointRuntimeClassCanonical documentation
@opentui/coreBun and Node.jsSupportedRenderer
@opentui/core/testingBun and Node.jsSupportedTesting
@opentui/core/runtime-pluginBun onlyRuntime-specific, AdvancedRuntime module loading
@opentui/core/runtime-plugin-supportBun onlyRuntime-specific, AdvancedRuntime module loading
@opentui/core/runtime-plugin-support/configureBun onlyRuntime-specific, AdvancedRuntime module loading
@opentui/core/yogaBun and Node.jsAdvancedYoga API
@opentui/core/tree-sitter/update-assetsBuild time, with Bun CLIRuntime-specificTree-sitter
@opentui/core/parser.workerBun and Node.js workerImplementation-looking public exportTree-sitter
@opentui/core/node-assetsNode.js build timeRuntime-specificStandalone executables
@opentui/reactBun and Node.jsSupportedReact bindings
@opentui/react/rendererBun and Node.jsSupported, Implementation-looking public exportReact bindings
@opentui/react/test-utilsBun and Node.jsSupportedTesting
@opentui/react/runtime-plugin-supportBun onlyRuntime-specific, AdvancedRuntime module loading
@opentui/react/runtime-plugin-support/configureBun onlyRuntime-specific, AdvancedRuntime module loading
@opentui/react/jsx-runtimeCompiler selectedSupportedReact bindings
@opentui/react/jsx-dev-runtimeCompiler selectedSupportedReact bindings
@opentui/solidBun and Node.jsSupportedSolid bindings
@opentui/solid/preloadBun onlyRuntime-specificSolid bindings
@opentui/solid/bun-pluginBun onlyRuntime-specific, AdvancedSolid bindings
@opentui/solid/runtime-plugin-supportBun onlyRuntime-specific, AdvancedRuntime module loading
@opentui/solid/runtime-plugin-support/configureBun onlyRuntime-specific, AdvancedRuntime module loading
@opentui/solid/componentsBun and Node.jsAdvancedSolid bindings
@opentui/solid/jsx-runtimeCompiler selectedSupportedSolid bindings
@opentui/solid/jsx-dev-runtimeCompiler selectedSupportedSolid bindings
@opentui/keymapJavaScript runtimesSupportedCore keymap API
@opentui/keymap/extrasJavaScript runtimesSupportedCore keymap API
@opentui/keymap/extras/graphJavaScript runtimesAdvancedCore keymap API
@opentui/keymap/addonsJavaScript runtimesSupportedBuilt-in keymap addons
@opentui/keymap/addons/opentuiBun and Node.jsSupportedBuilt-in keymap addons
@opentui/keymap/testingJavaScript test runtimesSupportedCore keymap API
@opentui/keymap/htmlBrowser DOMRuntime-specificKeymap hosts
@opentui/keymap/opentuiBun and Node.jsRuntime-specificKeymap hosts
@opentui/keymap/reactOpenTUI ReactRuntime-specificReact keymap integration
@opentui/keymap/solidOpenTUI SolidRuntime-specificSolid keymap integration
@opentui/keymap/runtime-modulesBun runtime loadingRuntime-specific, AdvancedRuntime module loading
@opentui/qrcodeBun and Node.jsSupportedQR encoder
@opentui/qrcode/reactOpenTUI ReactRuntime-specificQR code component
@opentui/qrcode/solidOpenTUI SolidRuntime-specificQR code component
@opentui/sshBun 1.3.14 or Node.js 26.4.0 or laterRuntime-specificSSH
@opentui/threeBun onlyRuntime-specific, AdvancedThree.js WebGPU
@opentui/three/runtime-modulesBun onlyRuntime-specific, AdvancedRuntime 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

AreaSymbolsClassCanonical documentation
RendererCliRenderer, CliRendererConfig, CliRendererErrorEvent, CliRendererExternalOutputEvent, CliRendererFrameEvent, CliRendererHandlerErrorEvent, CliRendererStats, CliRenderEvents, ConsoleMode, createCliRenderer, ExternalOutputMode, KittyKeyboardOptions, MouseButton, MouseEvent, PixelResolution, RendererControlState, ScreenModeSupportedRenderer
Scheduling and scrollbackRendererSchedulerState, ScrollbackRenderContext, ScrollbackSnapshot, ScrollbackSurface, ScrollbackSurfaceCommitOptions, ScrollbackSurfaceOptions, ScrollbackWriter, SplitFooterReplayResetOptionsAdvancedRenderer
Shared renderer typesCapturedFrame, CapturedLine, CapturedSpan, CursorStyle, CursorStyleOptions, DebugOverlayCorner, ImageRenderProtocol, MousePointerStyle, RenderContext, RendererEvents, TargetChannel, TerminalCapabilities, TerminalCapabilityState, TerminalInfo, TerminalMultiplexer, ThemeMode, Timeout, ViewportBounds, WidthMethodSupportedRenderer, Interaction, and Terminal capabilities
Cell and highlight typesATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, Highlight, LineInfo, LineInfoProvider, TextAttributesAdvancedText and terminal cells
RenderablesBaseRenderable, BaseRenderableOptions, isRenderable, LayoutEvents, LayoutOptions, Position, Renderable, RenderableEvents, RenderableOptions, RootRenderableSupportedRenderables
Composition constructsASCIIFont, Box, Code, FrameBuffer, Generic, Input, ScrollBox, Select, TabSelect, Text, vstylesImplementation-looking public exportRenderables
Composition internalsConstruct, DelegateMap, delegate, FunctionalConstruct, h, InstantiateFn, instantiate, isVNode, maybeMakeRenderable, PendingCall, ProxiedVNode, RenderableConstructor, ValidateShape, VChild, VNode, VRenderable, VRenderableOptions, wrapWithDelegatesImplementation-looking public exportRenderables
Layout string parsersAlignString, 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, WrapStringAdvancedLayout
Tree inspectionvisualizeRenderableTreeAdvancedRenderables

Input and selection

AreaSymbolsClassCanonical documentation
Keyboard eventsKeyEvent, KeyHandler, KeyHandlerEventMap, PasteEventSupportedKeyboard input
Keyboard implementationbuildKittyKeyboardFlags, InternalKeyHandlerImplementation-looking public exportKeyboard input
Key parserKeyEventType, nonAlphanumericKeys, ParsedKey, parseKeypress, ParseKeypressOptions, terminalNamedSingleStrokeKeysAdvancedKeyboard input
Raw input parserStdinEvent, StdinParser, StdinParserOptions, StdinParserProtocolContext, StdinResponseProtocolAdvancedKeyboard input
Mouse parserMouseEventType, MouseParser, RawMouseEvent, ScrollInfoAdvancedInteraction, focus, and selection
Paste decodingdecodePasteBytes, PasteKind, PasteMetadata, stripAnsiSequencesAdvancedKeyboard input
Scroll accelerationLinearScrollAccel, MacOSScrollAccel, ScrollAccelerationAdvancedInteraction, focus, and selection
SelectionASCIIFontSelectionHelper, convertGlobalToLocalSelection, LocalSelectionBounds, Selection, SelectionBehavior, SelectionOccupancyAdvancedInteraction, focus, and selection
AreaSymbolsClassCanonical documentation
Styled textbg, 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, yellowSupportedText and terminal cells
Color valuesansi256IndexToRgb, ColorInput, ColorIntent, DEFAULT_BACKGROUND_RGB, DEFAULT_FOREGROUND_RGB, hexToRgb, hsvToRgb, normalizeColorValue, NormalizedColorValue, normalizeIndexedColorIndex, parseColor, RGBA, rgbToHex, RGBTripletSupportedColors
Attributes and linksattributesWithLink, createTextAttributes, getLinkId, detectLinks, MAX_LINK_URL_BYTESAdvancedText and terminal cells
HAST conversionHASTElement, HASTNode, HASTText, hastToStyledTextAdvancedText and terminal cells
ClipboardClipboardClearResult, ClipboardOptions, ClipboardReadOptions, ClipboardReadResult, ClipboardRepresentation, ClipboardSelection, ClipboardService, ClipboardTarget, ClipboardWriteDestination, ClipboardWriteOptions, ClipboardWriteResult, createClipboard, createHostClipboard, createRendererClipboardAdapter, HostClipboardBackend, HostClipboardClearResult, HostClipboardOperationOptions, HostClipboardOptions, HostClipboardReadOptions, HostClipboardService, HostClipboardWriteOptions, HostClipboardWriteResult, RendererClipboardBoundary, TerminalClipboardAdapter, TerminalClipboardOperationResultSupportedClipboard

Tree-sitter and syntax styles

AreaSymbolsClassCanonical documentation
Client lifecycleaddDefaultParsers, destroyTreeSitterClient, getTreeSitterClient, TreeSitterClientSupportedTree-sitter
File type lookupbasenameToFiletype, extensionToFiletype, extToFiletype, infoStringToFiletype, pathToFiletypeSupportedTree-sitter
Styled outputtreeSitterToStyledText, TreeSitterToStyledTextOptions, treeSitterToTextChunksSupportedTree-sitter
Parser and result typesFiletypeParserOptions, HighlightMeta, HighlightRange, HighlightResponse, InjectionMapping, SimpleHighlight, TreeSitterClientEvents, TreeSitterClientOptionsSupportedTree-sitter
Worker protocolBufferState, Edit, ParsedBuffer, PerformanceStats, TreeSitterWorkerLogType, TreeSitterWorkerRequest, TreeSitterWorkerResponseAdvancedTree-sitter
Syntax stylesconvertThemeToStyles, MergedStyle, StyleDefinition, StyleDefinitionInput, SyntaxStyle, ThemeTokenStyleSupportedTree-sitter

Plugins, console, and process services

AreaSymbolsClassCanonical documentation
Generic slotscreateSlotRegistry, Plugin, PluginContext, PluginErrorEvent, PluginErrorPhase, PluginErrorReport, PluginErrorSource, ResolvedSlotRenderer, SlotMode, SlotRegistry, SlotRegistryOptions, SlotRendererSupportedPlugin slots
Core slotsCoreManagedSlot, CorePlugin, CoreResolvedSlotRenderer, CoreSlotContribution, CoreSlotFailurePlaceholder, CoreSlotMode, CoreSlotRegistry, CoreSlotRenderer, createCoreSlotRegistry, registerCorePlugin, resolveCoreSlot, SlotRenderable, SlotRenderableOptionsSupportedCore plugin slots
Console overlaycapture, ConsoleAction, ConsoleKeyBinding, ConsoleOptions, ConsolePosition, TerminalConsoleSupportedConsole overlay
Environment accessclearEnvCache, env, EnvVarConfig, registerEnvVarAdvancedEnvironment variables
Environment registry outputenvRegistry, generateEnvColored, generateEnvMarkdownImplementation-looking public exportEnvironment variables
Terminal palettebuildTerminalPaletteSignature, createTerminalPalette, GetPaletteOptions, NormalizedTerminalPalette, normalizeTerminalPalette, OscSubscriptionSource, TerminalColors, TerminalPalette, TerminalPaletteDetector, TerminalPaletteOptions, WriteFunctionAdvancedTerminal capabilities
Application pathsDataPaths, DataPathsEvents, DataPathsManager, getDataPathsAdvancedApplication data paths
ClocksClock, SystemClock, TimerHandleAdvancedAnimation and Timeline

Components and component helpers

Component or areaSymbolsClassCanonical documentation
ASCII fontASCIIFontName, ASCIIFontOptions, ASCIIFontRenderable, coordinateToCharacterIndex, fonts, getCharacterPositions, measureText, renderFontToFrameBufferSupportedASCII font
Box and bordersBorderCharacters, BorderCharArrays, BorderChars, borderCharsToArray, BorderConfig, BorderSides, BorderSidesConfig, BorderStyle, BoxDrawOptions, BoxOptions, BoxRenderable, getBorderFromSides, getBorderSides, isValidBorderStyle, parseBorderStyleSupportedBox
CodeChunkRenderContext, CodeOptions, CodeRenderable, HighlightContext, OnChunksCallback, OnHighlightCallbackSupportedCode
DiffDiffRenderable, DiffRenderableOptionsSupportedDiff
Embedded terminalEmbeddedTerminalDataSource, EmbeddedTerminalOptions, EmbeddedTerminalRenderable, EmbeddedTerminalScreenSupportedEmbedded terminal
Editable buffer renderableContentChangeEvent, CursorChangeEvent, EditBufferOptions, EditBufferRenderable, EditBufferRenderableEvents, EditorCapture, EditorTraits, isEditBufferRenderableAdvancedEditing buffers and views
Frame bufferFrameBufferOptions, FrameBufferRenderableAdvancedFrame buffer
Image displayImageFit, ImageRenderable, ImageRenderableOptions, ImageRenderableSource, resolveImageRenderProtocolSupportedImage
Video playbackVideoMetadata, VideoRenderable, VideoRenderableOptionsSupportedVideo
Kitty transportKittyImageTransport, KittyImageTransportStatusSupportedKitty transport
InputInputAction, InputKeyBinding, InputRenderable, InputRenderableEvents, InputRenderableOptionsSupportedInput
Line number gutterLineColorConfig, LineNumberOptions, LineNumberRenderable, LineSignSupportedLine number gutter
MarkdownBlockState, createMarkdownCodeBlockRenderer, MarkdownCodeBlockRenderer, MarkdownCodeBlockRendererMap, MarkdownOptions, MarkdownRenderable, MarkdownTableOptions, MarkdownTableStyle, RenderNodeContextSupportedMarkdown
Markdown parser stateParseStateImplementation-looking public exportMarkdown
Scroll barArrowOptions, ArrowRenderable, ScrollBarOptions, ScrollBarRenderable, ScrollUnitAdvancedScroll bar
Scroll boxScrollBoxOptions, ScrollBoxRenderableSupportedScroll box
SelectSelectAction, SelectKeyBinding, SelectOption, SelectRenderable, SelectRenderableEvents, SelectRenderableOptionsSupportedSelect
SliderSliderOptions, SliderRenderableSupportedSlider
Tab selectTabSelectAction, TabSelectKeyBinding, TabSelectOption, TabSelectRenderable, TabSelectRenderableEvents, TabSelectRenderableOptionsSupportedTab select
TextTextOptions, TextRenderableSupportedText
Text nodesisTextNodeRenderable, RootTextNodeRenderable, TextNodeOptions, TextNodeRenderableAdvancedText and terminal cells
Text tableTextTableCellContent, TextTableColumnFitter, TextTableColumnWidthMode, TextTableContent, TextTableOptions, TextTableRenderableSupportedText table
TextareadefaultTextareaKeyBindings, KeyBinding, SubmitEvent, TextareaAction, TextareaKeyAliasMap, TextareaOptions, TextareaRenderableSupportedTextarea
Text buffer renderableTextBufferOptions, TextBufferRenderableAdvancedEditing buffers and views
First-draw timestampTimeToFirstDrawOptions, TimeToFirstDrawRenderableSupportedTime to first draw

Buffers, editing, animation, and effects

AreaSymbolsClassCanonical documentation
Cell bufferOptimizedBufferAdvancedBuffer API
Text bufferTextBuffer, TextChunk, TextBufferViewAdvancedEditing buffers and views
EditingEditBuffer, EditorView, measureEditText, ViewportAdvancedEditing buffers and views
ExtmarkscreateExtmarksController, Extmark, ExtmarkOptions, ExtmarksControllerExperimental, AdvancedEditing buffers and views
TimelineAnimationOptions, createTimeline, getTimelineEngine, EasingFunctions, JSAnimation, Timeline, TimelineOptionsSupportedAnimation and Timeline
Animation engineengineImplementation-looking public exportAnimation and Timeline
EffectsCloudsEffect, CRTRollingBarEffect, DistortionEffect, FlamesEffect, RainbowTextEffect, VignetteEffectExperimental, AdvancedPost-processing effects
FiltersapplyAsciiArt, applyBrightness, applyChromaticAberration, applyGain, applyInvert, applyNoise, applySaturation, applyScanlines, BloomEffectExperimental, AdvancedPost-processing effects
MatricesACHROMATOPSIA_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_MATRIXAdvancedColor matrices

Images, audio, and native span output

AreaSymbolsClassCanonical documentation
NativeImage APIBlendMode, CompositeOptions, ExtendOptions, ExtractOptions, ImageColorStatus, ImageError, ImageErrorCode, ImageFormat, imageInfo, ImageInfo, ImageLoadError, ImageLoadErrorCode, ImageLoadOptions, ImageSource, NativeImage, NativeImagePool, NativeImagePoolOptions, OwnedRawImage, PixelFormat, PixelImportOptions, RawImage, ResizeKernel, ResizeOptionsAdvancedNativeImage
Audio playback and mixingAudio, AudioAction, AudioErrorContext, AudioEvents, AudioGroup, AudioInitializationAction, AudioInitializationError, AudioPlaybackDevice, AudioPlayOptions, AudioSetupOptions, AudioSound, AudioStartOptions, AudioVoice, setupAudioSupportedAudio
Streaming audioAudioStream, 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, IcyStreamDemuxerOptionsSupportedStreaming audio
Audio capture and recordingAudioCaptureDevice, AudioCaptureOptions, AudioCaptureReadResult, AudioCaptureStats, AudioCaptureStream, AudioCaptureStreamAction, AudioCaptureStreamError, AudioCaptureStreamErrorContext, AudioCaptureStreamEvents, AudioCaptureStreamOptions, AudioCaptureStreamState, AudioCaptureStreamStats, AudioRecorder, AudioRecorderAction, AudioRecorderError, AudioRecorderErrorContext, AudioRecorderEvents, AudioRecorderState, AudioRecorderStats, AudioRecordToFileOptionsSupportedAudio capture and recording
Native span outputDataHandler, NativeSpanFeedAdvancedNativeSpanFeed

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.

AreaSymbolsClassCanonical documentation
Standalone ownershipResourceContext, NativeResourceOwner, BufferAccess, EncodedUnicodeAdvancedCore resource ownership
Session driverNativeSession, NativeSessionDriverOptions, NativeSessionSchedulerAdvancedHow Core uses native
Renderable integrationNativeRenderableIntegrationAdvancedCustom renderables
Image ownershipImageCreateOptionsAdvancedNativeImage ownership
Checked errorsNativeError, NativeStatusAdvancedC results
AreaSymbolsClassCanonical documentation
Native handles and binding typesAudioEngineHandle, 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, VisualCursorImplementation-looking public exportThis section
Context and buffer bindingsNATIVE_BUFFER_TEXT_BYTES_MAX, NativeBufferDraw, NativeBufferGrid, NativeBufferStack, NativeContextBufferLease, NativeContextBufferOptions, NativeContextImageDraw, NativeContextOptions, NativeDrawingTargetImplementation-looking public exportThis section
Scene bindingsNATIVE_EDGE_NONE, NativeBorder, NativeSceneArrowOptions, NativeSceneBoxDetails, NativeSceneEditorOptions, NativeSceneFrame, NativeSceneFrameOptions, NativeSceneFrameRequest, NativeSceneHook, NativeSceneLayout, NativeScenePaint, NativeScenePaintPhase, NativeScenePaintSlot, NativeScenePaintUpdate, NativeSceneSliderOptions, NativeSceneTextMetrics, NativeSceneTextOptions, NativeSceneTextSelectionOptionsImplementation-looking public exportThis section
Session bindingsacquireSessionBufferLease, NATIVE_SESSION_CONTROL_PACKET_BYTES, NativeOutputTicket, NativeSessionBufferLease, NativeSessionCapabilities, NativeSessionControl, NativeSessionCursorOptions, NativeSessionKittyImageTransportStatus, NativeSessionOptions, NativeSessionPumpResult, NativeSessionPumpStatus, NativeSessionRendererOptions, NativeSessionRendererState, NativeSessionRenderStatus, NativeSessionSplitControl, NativeSessionState, NativeSessionTerminalOptions, NativeSessionTerminalPhase, NativeSplitSnapshot, SessionBufferImplementation-looking public exportThis section
Text and editor bindingsNativeContextEditBufferOptions, NativeEditBufferInfo, NativeEditCommand, NativeEditEvent, NativeEditEventName, NativeEditHighlightOperation, NativeEditorCommand, NativeEditorPositionQuery, NativeEditorReplacement, NativeEditorSelection, NativeEditorSelectionOperation, NativeEditorStyle, NativeEditorStyleMask, NativeEditorViewInfo, NativeEditorViewport, NativeEditPositionQuery, NativeEncodedStyledText, NativeTextBufferInfo, NativeTextViewCommandImplementation-looking public exportThis section
Native result structuresAllocatorStats, AudioStreamCreateOptions, BuildOptions, GrowthPolicy, NativeAudioCaptureStats, NativeAudioStreamStats, NativeRenderStats, NativeSpanFeedOptions, NativeSpanFeedStats, NativeVideoInfo, NativeVideoStateAdvancedThis section
Bundled asset resolutionresolveBundledFilePathImplementation-looking public exportStandalone executables
Yoga namespaceYogaAdvancedYoga API

Other @opentui/core entry points

Testing

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

AreaSymbolsClassCanonical documentation
Renderer setupcreateTestRenderer, MockInput, MockMouse, TestExternalOutput, TestExternalOutputCommit, TestFlushOptions, TestRenderer, TestRendererOptions, TestRendererSetup, TestVisualIdleOptions, TestWaitForOptionsSupportedTesting
Keyboard and mousecreateMockKeys, createMockMouse, KeyCodes, KeyInput, MockKeysOptions, MouseButton, MouseButtons, MouseEventOptions, MouseEventType, MouseModifiers, MousePosition, pasteBytesSupportedTesting
CapabilitiescreateTerminalCapabilities, setRendererCapabilities, TerminalCapabilitiesOverridesSupportedTesting
Deterministic helperscreateSpy, ManualClock, MockTreeSitterClientSupportedTesting
RecordingRecordedFrame, TestRecorderSupportedTesting

Runtime plugin support

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

Package entry pointSymbolsClassCanonical documentation
@opentui/core/runtime-plugincreateRuntimePlugin, CreateRuntimePluginOptions, isCoreRuntimeModuleSpecifier, RuntimeModuleEntry, RuntimeModuleExports, runtimeModuleIdForSpecifier, RuntimeModuleLoader, RuntimePluginRewriteOptions, RuntimeSpecifierPreserveRuntime-specific, AdvancedRuntime module loading
@opentui/core/runtime-plugin-supportcreateRuntimePlugin, CreateRuntimePluginOptions, ensureRuntimePluginSupport, RuntimeModuleEntry, RuntimeModuleExports, runtimeModuleIdForSpecifier, RuntimeModuleLoader, RuntimeSpecifierPreserveRuntime-specific, AdvancedRuntime module loading
@opentui/core/runtime-plugin-support/configurecreateRuntimePlugin, CreateRuntimePluginOptions, ensureRuntimePluginSupport, RuntimeModuleEntry, RuntimeModuleExports, runtimeModuleIdForSpecifier, RuntimeModuleLoader, RuntimeSpecifierPreserveRuntime-specific, AdvancedRuntime 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.

PurposeSymbolsClass
Objects and callback typesConfig, Node, default, DirtiedFunction, Layout, MeasureFunction, Size, ValueAdvanced
ErrorsYogaError, YogaStatusAdvanced
AlignmentAlign, ALIGN_AUTO, ALIGN_BASELINE, ALIGN_CENTER, ALIGN_FLEX_END, ALIGN_FLEX_START, ALIGN_SPACE_AROUND, ALIGN_SPACE_BETWEEN, ALIGN_SPACE_EVENLY, ALIGN_STRETCHAdvanced
Box sizingBoxSizing, BOX_SIZING_BORDER_BOX, BOX_SIZING_CONTENT_BOXAdvanced
DimensionsDimension, DIMENSION_HEIGHT, DIMENSION_WIDTHAdvanced
DirectionDirection, DIRECTION_INHERIT, DIRECTION_LTR, DIRECTION_RTLAdvanced
DisplayDisplay, DISPLAY_CONTENTS, DISPLAY_FLEX, DISPLAY_NONEAdvanced
EdgesEdge, EDGE_ALL, EDGE_BOTTOM, EDGE_END, EDGE_HORIZONTAL, EDGE_LEFT, EDGE_RIGHT, EDGE_START, EDGE_TOP, EDGE_VERTICALAdvanced
Compatibility errataErrata, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING, ERRATA_ALL, ERRATA_CLASSIC, ERRATA_NONE, ERRATA_STRETCH_FLEX_BASISAdvanced
Experimental featureExperimentalFeature, EXPERIMENTAL_FEATURE_WEB_FLEX_BASISExperimental, Advanced
Flex directionFlexDirection, FLEX_DIRECTION_COLUMN, FLEX_DIRECTION_COLUMN_REVERSE, FLEX_DIRECTION_ROW, FLEX_DIRECTION_ROW_REVERSEAdvanced
GapsGutter, GUTTER_ALL, GUTTER_COLUMN, GUTTER_ROWAdvanced
JustificationJustify, JUSTIFY_CENTER, JUSTIFY_FLEX_END, JUSTIFY_FLEX_START, JUSTIFY_SPACE_AROUND, JUSTIFY_SPACE_BETWEEN, JUSTIFY_SPACE_EVENLYAdvanced
LoggingLogLevel, LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_FATAL, LOG_LEVEL_INFO, LOG_LEVEL_VERBOSE, LOG_LEVEL_WARNAdvanced
MeasurementMeasureMode, MEASURE_MODE_AT_MOST, MEASURE_MODE_EXACTLY, MEASURE_MODE_UNDEFINEDAdvanced
Node typeNodeType, NODE_TYPE_DEFAULT, NODE_TYPE_TEXTAdvanced
OverflowOverflow, OVERFLOW_HIDDEN, OVERFLOW_SCROLL, OVERFLOW_VISIBLEAdvanced
PositionPositionType, POSITION_TYPE_ABSOLUTE, POSITION_TYPE_RELATIVE, POSITION_TYPE_STATICAdvanced
UnitsUnit, UNIT_AUTO, UNIT_PERCENT, UNIT_POINT, UNIT_UNDEFINEDAdvanced
WrappingWrap, WRAP_NO_WRAP, WRAP_WRAP, WRAP_WRAP_REVERSEAdvanced

Tree-sitter assets, worker, and Node assets

Package entry pointRuntimeSymbolsClassCanonical documentation
@opentui/core/tree-sitter/update-assetsBuild time, with Bun CLIrunUpdateAssetsCli, updateAssets, UpdateOptionsRuntime-specificTree-sitter
@opentui/core/parser.workerBun and Node.js workerNo named application exportsImplementation-looking public exportTree-sitter
@opentui/core/node-assetsNode.js build timegetNodeAssets, NodeAsset, NodeAssetTargetRuntime-specificStandalone executables

@opentui/react

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

Root exports

AreaSymbolsClassCanonical documentation
Root renderingcreateElement, createPortal, createRoot, flushSync, RootSupportedReact bindings
Application contextAppContext, useAppContextSupportedReact bindings
HooksuseBlur, useFocus, useKeyboard, UseKeyboardOptions, useOnResize, usePaste, useRenderer, useSelectionHandler, useTerminalDimensions, useTimelineSupportedReact bindings
Catalogue extensionextend, ExtendedComponentProps, ExtendedIntrinsicElements, getComponentCatalogue, OpenTUIComponents, RenderableConstructorAdvancedReact bindings
Catalogue objectsbaseComponents, componentCatalogueImplementation-looking public exportReact bindings
Component prop typesAsciiFontProps, BoxProps, CodeProps, DiffProps, GetNonStyledProperties, ImageProps, InputProps, LineBreakProps, LineNumberProps, LinkProps, MarkdownProps, NonStyledProps, ReactProps, ScrollBoxProps, SelectProps, SpanProps, TabSelectProps, TextareaProps, TextPropsSupportedComponents overview
Plugin slotscreateReactSlotRegistry, createSlot, ReactBoundSlotProps, ReactPlugin, ReactRegistrySlotComponent, ReactSlotComponent, ReactSlotOptions, ReactSlotProps, Slot, SlotModeSupportedReact plugin slots
First-draw timestampTimeToFirstDraw, TimeToFirstDrawPropsSupportedTime to first draw

Other React entry points

Package entry pointSymbolsClassCanonical documentation
@opentui/react/renderer declarationscreatePortal, createRoot, flushSync, RootSupportedReact bindings
@opentui/react/renderer runtimeAll runtime values from @opentui/reactImplementation-looking public exportReact bindings
@opentui/react/test-utilstestRenderSupportedTesting
@opentui/react/runtime-plugin-supportensureRuntimePluginSupport, ReactRuntimePluginSupportOptionsRuntime-specific, AdvancedRuntime module loading
@opentui/react/runtime-plugin-support/configureensureRuntimePluginSupport, ReactRuntimePluginSupportOptionsRuntime-specific, AdvancedRuntime module loading
@opentui/react/jsx-runtimeFragment, jsx, jsxs, JSXSupportedReact bindings
@opentui/react/jsx-dev-runtimeFragment, jsxDEV, JSXSupportedReact 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

AreaSymbolsClassCanonical documentation
Root renderingrender, testRenderSupportedSolid bindings
HooksonBlur, onFocus, onResize, useKeyboard, UseKeyboardOptions, usePaste, useRenderer, useSelectionHandler, useTerminalDimensions, useTimelineSupportedSolid bindings
Renamed hookuseKeyHandlerDeprecatedUse useKeyboard in Solid bindings.
ComponentscreateDynamic, Dynamic, DynamicProps, PortalSupportedSolid bindings
ScrollbackcreateScrollbackWriter, SolidScrollbackNode, SolidScrollbackWriterOptions, writeSolidToScrollbackAdvancedRenderer
Catalogue extensionextend, ExtendedComponentProps, ExtendedIntrinsicElements, getComponentCatalogue, OpenTUIComponents, RenderableConstructorAdvancedSolid bindings
Catalogue and text wrappersbaseComponents, BoldSpanRenderable, componentCatalogue, ItalicSpanRenderable, LineBreakRenderable, LinkOptions, LinkRenderable, TextNodeKey, textNodeKeys, UnderlineSpanRenderableImplementation-looking public exportSolid bindings
Reconciler_render, createComponent, createElement, createSlotNode, createTextNode, DomNode, effect, insert, insertNode, memo, mergeProps, removeNode, setProp, spread, useImplementation-looking public exportSolid bindings
Reconciler context and wrappersLayoutSlotRenderable, RenderableContext, RendererContext, SlotRenderable, TextSlotRenderableImplementation-looking public exportSolid bindings
Component prop typesAsciiFontProps, BoxProps, CodeProps, ElementProps, GetNonStyledProperties, ImageProps, InputProps, LinkProps, MarkdownProps, NonStyledProps, ScrollBoxProps, SelectProps, SpanProps, TabSelectProps, TextareaProps, TextPropsSupportedComponents overview
Plugin slotscreateSlot, createSolidSlotRegistry, Slot, SlotMode, SolidBoundSlotProps, SolidPlugin, SolidRegistrySlotComponent, SolidSlotComponent, SolidSlotOptions, SolidSlotPropsSupportedSolid plugin slots
JSX namespaceJSXSupportedSolid bindings
First-draw timestampTimeToFirstDraw, TimeToFirstDrawPropsSupportedTime to first draw

Other Solid entry points

Package entry pointSymbolsClassCanonical documentation
@opentui/solid/preloadNo named exports. Importing it installs the Bun source transform.Runtime-specificSolid bindings
@opentui/solid/bun-plugincreateSolidTransformPlugin, CreateSolidTransformPluginOptions, default, ensureSolidTransformPlugin, resetSolidTransformPluginStateRuntime-specific, AdvancedSolid bindings
@opentui/solid/runtime-plugin-supportensureRuntimePluginSupport, SolidRuntimePluginSupportOptionsRuntime-specific, AdvancedRuntime module loading
@opentui/solid/runtime-plugin-support/configureensureRuntimePluginSupport, SolidRuntimePluginSupportOptionsRuntime-specific, AdvancedRuntime module loading
@opentui/solid/componentsextend, ExtendedComponentProps, ExtendedIntrinsicElements, getComponentCatalogue, OpenTUIComponentsAdvancedSolid bindings
@opentui/solid/jsx-runtimeFragment, jsx, jsxDEV, jsxs, JSXSupportedSolid bindings
@opentui/solid/jsx-dev-runtimeFragment, jsxDEV, JSXSupportedSolid 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.

KindSymbolsClassCanonical documentation
ValuesKeymap, KEYMAP_EXTENSION_CONTEXT, stringifyKeySequence, stringifyKeyStrokeSupportedCore keymap API
TypesActiveBinding, 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, WarningEventSupportedCore keymap API

Extras and graph

Package entry pointSymbolsClassCanonical documentation
@opentui/keymap/extrasBindingCommandMap, BindingConfig, BindingConfigItem, BindingDefaults, BindingDefaultsContext, BindingLookup, BindingValue, CommandBindingMap, commandBindings, CommandBindingsError, CommandBindingsOptions, CommandBindingsOverrideWarning, createBindingLookup, CreateBindingLookupOptions, formatCommandBindings, FormatCommandBindingsOptions, formatKeySequence, FormatKeySequenceOptions, KeyModifierName, KeySequenceFormatPart, SequenceBindingLike, TokenDisplayResolverSupportedCore keymap API
@opentui/keymap/extras/graphcreateGraphExtra, getGraphSnapshot, GraphBinding, GraphCommand, GraphInactiveReason, GraphLayer, GraphSequenceNode, GraphSnapshot, GraphSnapshotOptions, KeymapGraphExtraAdvancedCore keymap API

Addons

Package entry pointSymbolsClassCanonical documentation
@opentui/keymap/addonsAliases, 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, TimedLeaderOptionsSupportedBuilt-in keymap addons
@opentui/keymap/addons/opentuiEvery export from @opentui/keymap/addons, plus createTextareaBindings, EditBufferCommandName, EditBufferCommandOptions, EditBufferFineGroup, registerBaseLayoutFallback, registerEditBufferCommands, registerManagedTextareaLayer, registerTextareaMappingSuspensionSupportedBuilt-in keymap addons and Custom keymap addons

Testing and hosts

Package entry pointRuntimeSymbolsClassCanonical documentation
@opentui/keymap/testingJavaScript test runtimescaptureKeymapDiagnostics, createTestHostMetadata, createTestKeymap, createTestKeymapHost, CreateTestKeymapHostOptions, CreateTestKeymapOptions, DEFAULT_TEST_HOST_METADATA, TestDiagnosticCapture, TestHostMetadataOptions, TestKeymapEvent, TestKeymapHarness, TestKeymapHost, TestKeymapTarget, TestKeyModifierOptionsSupportedCore keymap API
@opentui/keymap/htmlBrowser DOMcreateDefaultHtmlKeymap, createHtmlKeymap, createHtmlKeymapEvent, createHtmlKeymapHost, htmlEventMatchResolver, HtmlKeymapEvent, normalizeHtmlKeyNameRuntime-specificKeymap hosts
@opentui/keymap/opentuiBun and Node.jscreateDefaultOpenTuiKeymap, createOpenTuiKeymap, createOpenTuiKeymapHostRuntime-specificKeymap hosts

Frameworks and runtime modules

Package entry pointSymbolsClassCanonical documentation
@opentui/keymap/reactKeymapProvider, KeymapProviderProps, reactiveMatcherFromStore, useActiveKeys, useBindings, UseBindingsLayer, UseBindingsTargetRef, useKeymap, usePendingSequenceRuntime-specificReact keymap integration
@opentui/keymap/solidKeymapProvider, KeymapProviderProps, reactiveMatcherFromSignal, useBindings, UseBindingsLayer, UseBindingsTarget, useKeymap, useKeymapSelectorRuntime-specificSolid keymap integration
@opentui/keymap/runtime-modulesruntimeModulesRuntime-specific, AdvancedRuntime 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 pointSymbolsClassCanonical documentation
@opentui/qrcodeByteEncoding, createQrSvg, EciAssignment, EncodeOptions, encodeTextBytes, ErrorCorrectionLevel, Fnc1SecondPositionInfo, Gs1Element, QRCode, QRCodeFitMode, QRCodeOptions, QRCodeRenderable, QrSegment, StructuredAppendInfo, TerminalRenderOptionsSupportedQR encoder and QR code component
@opentui/qrcode/reactEvery root export, plus registerQRCodeRuntime-specificQR code component
@opentui/qrcode/solidEvery root export, plus registerQRCodeRuntime-specificQR 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.

SymbolsClassCanonical 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, SshErrorRuntime-specificSSH

@opentui/three

Both entry points are Bun-only.

Package entry pointSymbolsClassCanonical documentation
@opentui/threeAnimationDefinition, 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, TiledSpriteRuntime-specific, AdvancedThree.js WebGPU
@opentui/three/runtime-modulesruntimeModulesRuntime-specific, AdvancedRuntime 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.

AreaSymbolsCanonical documentation
ABI versionOT_CONTEXT_ABI_VERSIONBuild the library
Contextsot_context, ot_context_create, ot_context_destroy, ot_context_optionsGroup resources in a Context
Handlesot_handleA handle names an object
Resultsot_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_LEASEInitialize records and check results
Sessionsot_session_create, ot_session_options, ot_session_attach_renderer, ot_session_renderer_options, ot_session_setup_terminal, OT_INVALID_PHASEAdd a Session for output
Shared resourcesot_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_VIEWCreate shared resources in one Context
Imagesot_image_decode, ot_image_inspect, ot_image_create_pixels, ot_image_take_pixels, ot_image_pixels_release, ot_image_clone, ot_image_retainCreate images in a Context
Videoot_scene_set_video, ot_video_open, ot_video_info, ot_video_play, ot_video_pause, ot_video_seek, ot_video_set_loop, ot_video_set_muted, ot_video_set_volume, ot_video_set_av_sync_offset, ot_video_set_max_fps, ot_video_get_state, ot_video_state, ot_video_get_error, OT_SCENE_VIDEO, OT_VIDEO_FAILEDResources
Buffer leasesot_buffer_acquire_lease, ot_buffer_lease_validate, ot_buffer_lease_get_real_char_size, ot_buffer_lease_write_resolved_chars, ot_buffer_lease_releaseBorrow cells for one synchronous operation
Owned buffersot_scene_set_surface, ot_scene_frame_draw_buffer, ot_session_draw_buffer, OT_SCENE_CUSTOMCompose an owned buffer
Text and geometryot_scene_get_layout, ot_scene_set_styled_text, ot_styled_text_chunk, ot_scene_text_info, OT_LAYOUT_PUBLIC, OT_LAYOUT_YOGA, OT_LAYOUT_PAINTRead text and geometry
Teardownot_scene_destroy_node, ot_session_cancel, ot_session_close, ot_session_destroy, OT_CLIPBOARD_START_SHUTTING_DOWNFinish work before destroying owners
Scene nodesot_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_TEXTAdd the box and label
Host drawingot_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_AFTERAdd host drawing
Paint and deliverot_scene_paint, ot_scene_frame_request, ot_scene_frame_commit, ot_session_complete_output, OT_UNSUPPORTED_RESOURCEPaint, submit, and deliver
Frame requestsot_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_HOOK_UPDATE, OT_SCENE_HOOK_RESIZE, OT_SCENE_HOOK_LAYOUT_CHANGEDRead and acknowledge requests
Paint hooksot_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_CLEARRecord paint hooks
Measurementot_scene_set_measure, ot_scene_measure_callbackMeasure custom content
Property updatesot_scene_flush, OT_SCENE_PROPERTY_STYLE, OT_SCENE_MUTATIONS_MAX, OT_SCENE_PROPERTY_BYTES_MAXSubmit property updates
Changes during a frameot_scene_frame_cancel, ot_scene_set_viewport, OT_FRAME_REQUEST_LIMIT, OT_LAYOUT_LIMITChange the scene during a frame
Framebuffer accessot_scene_frame_acquire_buffer_lease, ot_session_acquire_buffer_leaseAccess the framebuffer
Rendering and outputot_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_FAILEDCommit the draft, then complete output
Output storageot_session_get_write_limit, OT_SESSION_CONTROL_PACKET_BYTESReserve output storage
Terminal workot_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_RESPONSEPump terminal work and close
Host outputOT_OUTPUT_BUSY, OT_OUTPUT_FAILEDOutput without a host copy
Deadlinesot_session_pump_exit, ot_session_poll_kitty_image_transportOne Session deadline clock
Core integrationot_context_set_edit_event_callback, ot_edit_event_callback, OT_BUFFER_TEXT_BYTES_MAXHow 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(). Replace a style read such as getLayoutNode().getMaxWidth() with the renderable method of the same name, getMaxWidth(). Replace markDirty() with invalidateIntrinsicSize(), and the computed position and size getters with getLayout(). Computed padding, margin, and border have no replacement. 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, clock, 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 show control characters other than tab, carriage return, and line feed as notation, such as ^L or <85>. In 0.5.14, the cursor could not move past or delete them, and the terminal received 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.