celina

Search:
Group by:

Celina - A CLI library for Nim inspired by Ratatui.

A powerful Terminal User Interface library for Nim, inspired by Ratatui. Provides high-performance, type-safe components for building interactive terminal applications with both synchronous and asynchronous support.

Basic Usage:

import pkg/celina

proc main() =
  var app = newApp()
  app.run()

Async Usage (requires -d:asyncBackend=asyncdispatch or -d:asyncBackend=chronos):

import pkg/celina

proc main() {.async.} =
  var app = newAsyncApp()
  await app.runAsync()

Modules

Core

  • app — Application lifecycle and event loop
  • buffer — Screen buffer for managing terminal content
  • colors — Color and style definitions
  • cursor — Cursor control and state management
  • errors — Error types
  • events — Keyboard and mouse event handling
  • fps — Frame rate monitoring
  • geometry — Geometric types for positioning and sizing
  • layout — Constraint-based layout system
  • renderer — Differential rendering and terminal output
  • terminal — Terminal control using ANSI escape sequences
  • terminal_common — Shared terminal algorithms and utilities
  • windows — Window management with overlapping and focus support

Async

  • async_backend — Async backend configuration (asyncdispatch/chronos)
  • async_app — Async application framework and event loop
  • async_buffer — Async-safe buffer implementation
  • async_events — Async keyboard and mouse event handling
  • async_terminal — Async terminal I/O interface

Widgets

  • base — Base widget traits and types
  • button — Interactive button widget
  • input — Text input widget with cursor and selection
  • list — List widget with scrolling and selection
  • progress — Progress bar widget
  • table — Table widget for structured data
  • tabs — Tabbed interface widget
  • text — Text rendering widget with alignment and styling

Exports

Position, size, position, isValid, isValid, Rect, size, shrink, contains, union, contains, $, $, center, Area, isEmpty, rect, Size, -, rect, $, pos, VAlign, area, area, expand, shrink, intersects, bottom, +, intersection, right, HAlign, indigo, color256, grayscale, toAnsiCode, ==, withModifiers, $, Style, defaultStyle, $, deepSkyBlue, hotPink, toAnsiCode, bold, color256, reversed, hsv, ansiToRgb, rgb, hsvToRgb, toRgb, ColorValue, withBg, style, ==, withFg, brightColors, Color, default, color, salmon, teal, addModifier, italic, ColorKind, violet, cubeColor, toAnsiSequence, RgbColor, crimson, limeGreen, withBg, $, style, ansi256ToRgb, ==, defaultColor, orange, lerp, underline, toAnsiCode, withFg, rgb, darkColors, resetSequence, gold, toBgAnsiCode, lerp, StyleModifier, rgb, toAnsiCode, removeModifier, pastels, diff, getDirtyRegionSize, runesWidth, setString, displayWidth, width, clone, minX, Buffer, ==, DefaultTabWidth, $, $, maxX, [], runeWidth, maxY, setCell, cell, isShadow, Cell, setCell, markDirty, boundingBox, setString, resize, isDirty, truncateToWidth, markDirtyRect, setCell, isRowDirty, clear, isValidPos, isEmpty, []=, DirtyRegion, clearDirty, setCell, isDirty, cell, ==, setString, setRunes, minY, []=, setString, isValidPos, merge, RowDirty, fill, merge, newBuffer, cell, toStrings, getCell, setRunes, setString, newBuffer, [], readKey, Utf8ValidationResult, isStdinNonBlockingPinned, $, buildUtf8String, validateUtf8Sequence, pendingByte, setStdinNonBlockingPinned, EventKind, Utf8ReplacementChar, MouseEvent, readKeyInput, hasInput, utf8ByteLength, parseEscapeSequenceUnified, clearPendingByte, utf8SecondByteRange, waitForKey, pollEvents, truncateUtf8, MouseEventKind, KeyCode, KeyModifier, pollKey, Utf8AssemblyResult, assembleUtf8Char, $, waitForAnyKey, $, utf8CharLength, Event, EventResult, MouseButton, KeyEvent, Utf8ByteSource, isUtf8ContinuationByte, min, twoColumnPercent, withMargins, fill, percentage, Constraint, evenSplit, LayoutSolver, withMargin, Layout, length, layout, vertical, max, threeRow, twoColumn, ConstraintKind, $, split, Direction, ratio, horizontal, $, render, setCursorPosition, setCursorStyle, setTitleOnly, withTerminal, cleanup, setupWithMouseAndPaste, suspend, saveCursor, setupWithMouse, enableRawMode, showCursor, disableAlternateScreen, getSize, disableFocusEvents, clearToEndOfLine, clearLine, resume, clearScreen, TerminalError, updateSize, draw, renderCell, restoreCursor, hideCursor, clearToStartOfLine, disableBracketedPaste, getTerminalSize, Terminal, setIconName, drawWithCursor, withTerminal, moveCursorRight, moveCursorUp, moveCursorLeft, enableFocusEvents, isSuspended, setCursorPosition, disableMouse, setup, drawAdopt, enableAlternateScreen, moveCursorDown, disableRawMode, enableBracketedPaste, disableSyncOutput, setupWithPaste, renderFull, enableSyncOutput, setWindowTitle, getTerminalSizeOrDefault, enableMouse, newTerminal, setupWithHiddenCursor, drawWithCursorAdopt, moveCursor, EventError, tryRecover, ensureNotNil, newTerminalError, newLayoutError, checkSystemCall, checkSystemCallVoid, newRenderError, TerminalError, ensure, newEventError, tryIO, RenderError, LayoutError, newBufferError, withResource, withErrorContext, withContext, BufferError, debugLog, CursorUpSeq, applyTerminalConfig, HideCursorSeq, WriteBlockedWaitMs, makeWindowTitleSeq, CursorRightSeq, adoptLastBufferImpl, makeCursorPositionSeq, getSize, makeTitleOnlySeq, ClearToStartOfLineSeq, supportsAnsi, generateRenderBatch, OscTitleOnlyStart, getTerminalSizeFromSystem, AlternateScreenExit, MouseSequences, clearLastBufferForResume, MouseMode, CursorStyleSteadyBar, BracketedPasteDisable, calculateRenderMetrics, CursorLeftSeq, WriteWaitOutcome, isTerminalInteractive, getTerminalCapabilities, classifyWriteResult, CursorState, Osc8End, RenderCommandKind, SyncOutputEnable, buildOutputWithCursor, optimizeRenderBatch, buildOutputString, SaveCursorSeq, WriteMaxBlockedWaits, getArea, SyncOutputDisable, OscIconNameStart, Osc8Start, buildDifferentialOutput, OscWindowTitleStart, calculateSimpleDiff, RenderBatch, ClearScreenSeq, makeHyperlinkStartSeq, AlternateScreenEnter, WriteOutcome, Osc8Reset, CursorStyleBlinkingUnderline, getRawModeConfig, ClearToEndOfLineSeq, OscTerminator, enableMouseMode, CursorStyleBlinkingBlock, CursorStyle, ShowCursorSeq, BracketedPasteEnable, FocusEventsDisable, isAlternateScreen, disableMouseMode, AnsiSequence, TerminalConfig, CursorStyleSteadyUnderline, makeIconNameSeq, FocusEventsEnable, SuspendState, CursorStyleSteadyBlock, saveSuspendState, makeCursorPositionSeq, wrapWithSyncOutput, parseMouseEvent, restoreSuspendedFeatures, writeAllBlocking, buildFullRenderOutput, isRawMode, RenderMetrics, CursorStyleDefault, getCursorStyleSeq, RestoreCursorSeq, CursorStyleBlinkingBar, pollWritable, CursorDownSeq, makeCursorMoveSeq, isMouseEnabled, isSuspended, addCommand, RenderCommand, getTerminalSizeWithFallback, ClearLineSeq, restoreTerminal, App, dispatchEvent, onEvent, onRender, $, getTargetFps, enableWindowMode, removeWindow, resume, focusWindow, getCurrentFps, getWindow, withMouseCapture, moveCursorBy, isSuspended, onEvent, onTick, onTimeout, TickResult, setCursorPosition, disableMouse, defaultAppConfig, getWindowInfo, quickRun, onTick, withFocusEvents, quickRun, getApplicationTimeout, run, AppTimings, withTitle, resetCursor, hideCursor, dispatchTick, addWindow, isRunning, onTick, withSuspend, celina/core/config, installDefaultCrashGuard, setCursorStyle, getConfig, withBracketedPaste, AppState, setTargetFps, getCursorStyle, getBufferContent, onRender, celinaVersion, showCursor, onTimeout, $, onTimeout, onEvent, onTimeout, getBuffer, AppConfig, setCursorPosition, dispatchRender, getBufferCell, withRawMode, withWindowMode, getFocusedWindowId, getWindows, getTerminalSize, getFrameCount, showCursorAt, isCursorVisible, newApp, getLastFrameTime, DefaultAppConfig, withInstallSignalHandler, setApplicationTimeout, onEvent, showCursorAt, dispatchTimeout, quickRun, onTick, withTargetFps, getFocusedWindow, quit, withAlternateScreen, suspend, enableMouse, getWindowCount, getCursorPosition, handleWindowEvent, quickRun, defineBufferDelegation, defineMouseDelegation, defineCursorDelegation, defineFpsDelegation, defineWindowDelegation, defineQuit, defineShow, defineTimeoutAccessors, defineStateQueries, defineTickHandlerSettersAsync, defineEventHandlerSetters, defineTickHandlerSetters, defineTimeoutHandlerSettersAsync, wrapHandler, toEventResult, defineRenderHandlerSetters, toTickResult, defineEventHandlerSettersAsync, defineTimeoutHandlerSetters, defineRenderHandlerSettersAsync, Renderer, render, showCursorAt, clear, setCursorPosition, renderDiff, getCursorManager, isCursorVisible, forceRender, showCursorAt, getBuffer, hideCursor, resize, newRenderer, setString, resize, getCursorPosition, setCursorPosition, showCursor, setCursorStyle, newCursorManager, isVisible, setPosition, styleChanged, hide, setStyle, updateLastStyle, setLastStyle, CursorState, CursorManager, reset, showAt, setPosition, show, getStyle, getState, hasPosition, getPosition, getRemainingFrameTime, getTargetFps, getFrameTimeout, endFrame, setTargetFps, getStats, newFpsMonitor, shouldRender, getCurrentFps, FpsMonitor, startFrame, PerfStats, WindowState, render, move, render, bringToFront, setBorder, defaultBorder, WindowKeyHandler, ==, getVisibleWindows, Window, defaultBorderChars, show, getContentSize, WindowBorder, hide, BorderKind, $, $, getContentBuffer, findWindowAt, $, currentModal, handleEvent, focusWindow, addWindow, newWindow, getWindow, setResizeHandler, setMouseHandler, resize, restore, focused, manager=, sendToBack, removeWindow, setKeyHandler, manager, setEventHandler, WindowInfo, WindowMouseHandler, maximize, setKeyHandler, dispatchResize, WindowManager, WindowId, bindWidget, clearEventHandlers, minimize, setEventHandler, toWindowInfo, setTitle, WindowEventHandler, handleWindowEvent, newWindowManager, BorderChars, setMouseHandler, setArea, getFocusedWindow, WindowResizeHandler, NoBorder, SimpleBorder, RoundedBorder, SingleBorder, BorderChars, getBorderChars, defaultBorderChars, BorderStyle, DoubleBorder, BorderKind, registerFD, asyncBackend, sleepMs, hasChronos, unregisterFD, CancelledError, hasAsyncDispatch, hasAsyncSupport, hasAsyncSupport, hasChronos, hasAsyncDispatch, restoreTerminal, AsyncAppError, dispatchRenderAsync, removeWindow, getTargetFps, enableWindowMode, AsyncApp, AsyncAppState, focusWindow, showCursorAt, onEventAsync, quickRunAsync, getCurrentFps, getWindow, withMouseCapture, moveCursorBy, quickRunAsync, onTickAsync, isInputReaderLive, onTickAsync, TickResult, setCursorPosition, disableMouse, dispatchTickAsync, defaultAppConfig, getWindowInfo, onRenderAsync, runAsync, getFocusedWindowId, withFocusEvents, getApplicationTimeout, dispatchTimeoutAsync, withTitle, resetCursor, hideCursor, getBuffer, isRunning, onRenderAsync, AppConfig, celina/core/config, setCursorStyle, getConfig, withBracketedPaste, setTargetFps, AsyncAppTimings, onEventAsync, getCursorStyle, isSuspended, getBufferContent, resumeAsync, onTimeoutAsync, celinaVersion, showCursor, $, newAsyncApp, $, addWindow, setCursorPosition, onEventAsync, getBufferCell, withRawMode, withWindowMode, onTimeoutAsync, dispatchEventAsync, getWindows, getTerminalSize, getFrameCount, onTickAsync, isCursorVisible, getLastFrameTime, quit, DefaultAppConfig, withInstallSignalHandler, quickRunAsync, setApplicationTimeout, suspendAsync, onTimeoutAsync, onTickAsync, showCursorAt, withSuspendAsync, quickRunAsync, onTimeoutAsync, withTargetFps, getFocusedWindow, onEventAsync, withAlternateScreen, enableMouse, getWindowCount, getCursorPosition, handleWindowEvent, enableBracketedPasteAsync, suspendAsync, drawWithCursorAdoptAsync, drawAsync, moveCursorUpAsync, setupWithPasteAsync, cleanup, enableRawMode, setupWithHiddenCursorAsync, moveCursorRightAsync, enableSyncOutputAsync, disableMouseAsync, clearToStartOfLineAsync, getTerminalSizeAsync, showCursorAtAsync, disableAlternateScreen, disableFocusEvents, setCursorStyleAsync, newAsyncTerminal, setupWithMouseAsync, getSize, enableSyncOutput, restoreCursorAsync, hideCursorAsync, disableBracketedPaste, updateSize, clearToEndOfLineAsync, enableAlternateScreenAsync, enableBracketedPaste, drawAsync, moveCursorAsync, clearLineAsync, enableMouseAsync, showCursorAsync, disableBracketedPasteAsync, setCursorPositionAsync, renderAsync, drawWithCursorAsync, setWindowTitleAsync, setupAsync, moveCursorDownAsync, AsyncTerminalError, disableAlternateScreenAsync, isSuspended, enableFocusEvents, withAsyncTerminal, disableMouse, setTitleOnlyAsync, enableAlternateScreen, disableFocusEventsAsync, renderCellAsync, disableRawMode, disableSyncOutput, setIconNameAsync, clearScreenAsync, setupWithMouseAndPasteAsync, resumeAsync, enableFocusEventsAsync, showCursorAtAsync, moveCursorLeftAsync, saveCursorAsync, renderFullAsync, setCursorPositionAsync, enableMouse, disableSyncOutputAsync, cleanupAsync, getArea, AsyncTerminal, grayscale, underline, setString, color256, isValid, setRunesAsync, updateFromBuffer, toAnsiCode, mergeAsync, rgb, ==, contains, center, ==, setCell, newBuffer, AsyncBufferPool, $, cell, -, setCell, newAsyncBufferPool, VAlign, toAnsiCode, area, withAsyncBuffer, resizeAsync, intersection, HAlign, hsv, ansiToRgb, clear, isValidPos, isEmpty, hsvToRgb, DirtyRegion, newAsyncBuffer, Buffer, withBg, isDirty, size, ==, diff, color, default, updateFromBufferAsync, rgb, merge, ==, newBuffer, cell, bottom, ansi256ToRgb, stats, isDirty, getDirtyRegionSize, isShadow, violet, toAnsiSequence, getDirtyRegionSize, withBufferAsync, setRunes, DefaultTabWidth, crimson, $, clearAsync, bold, maxX, right, style, AsyncBuffer, size, getCell, width, clear, italic, returnBuffer, $, salmon, boundingBox, setString, truncateToWidth, setRunes, $, cell, []=, toAnsiCode, setStringAsync, setCell, defaultStyle, setCell, withFg, $, darkColors, merge, resetSequence, withBuffer, RowDirty, gold, RgbColor, pos, toBgAnsiCode, toStrings, setCellAsync, StyleModifier, intersects, toAnsiCode, pastels, [], [], Position, indigo, withFg, displayWidth, clone, diffAsync, minX, clone, isEmpty, clearDirty, withModifiers, shrink, toBufferAsync, position, $, destroyAsync, Area, runeWidth, maxY, getSize, deepSkyBlue, hotPink, markDirty, color256, setRunesAsync, resize, style, markDirtyRect, newAsyncBuffer, Size, Color, teal, fillAsync, toRgb, ColorValue, toBuffer, Style, lerp, setString, setRunes, minY, []=, ColorKind, isValidPos, brightColors, $, fill, expand, shrink, setRunes, addModifier, getArea, orange, setString, cubeColor, Rect, setString, limeGreen, isValid, contains, withBg, $, isDirty, lerp, setCellAsync, destroyAsyncBufferPool, ==, area, getBuffer, defaultColor, +, getCell, $, isRowDirty, setStringAsync, clearDirty, Cell, rgb, setString, union, rect, runesWidth, clearDirtyAsync, rect, reversed, toStringsAsync, getCell, removeModifier, setString, waitForKeyAsync, stopAsync, pollKeyAsync, startAsync, newAsyncEventStream, AsyncEventError, readKeyAsync, AsyncEventStream, waitForAnyKeyAsync, pollEventsAsync