cel-tui
    Preparing search index...

    Variable celConst

    cel: {
        init(term: Terminal, options?: { theme?: Theme }): void;
        render(): void;
        setTitle(title: string): void;
        stop(): void;
        viewport(fn: RenderFn): void;
    } = ...

    cel-tui framework entrypoint.

    The framework is stateless — it renders whatever tree the render function returns. State management is fully external. Use any approach you like (plain variables, classes, libraries) and call cel.render when state changes.

    Type Declaration

    • init: function
      • Initialize the framework with a terminal implementation. Must be called before cel.viewport.

        Enables the Kitty keyboard protocol (level 1) and bracketed paste mode via the terminal, enters raw mode, and starts mouse tracking.

        Parameters

        • term: Terminal

          Terminal to render to (ProcessTerminal or MockTerminal).

        • Optionaloptions: { theme?: Theme }

          Optional configuration.

          • Optionaltheme?: Theme

            Color theme mapping. Defaults to the ANSI 16 theme.

        Returns void

    • render: function
      • Request a re-render. Call this after state changes.

        Batched via process.nextTick() — multiple calls within the same tick produce a single render.

        Returns void

    • setTitle: function
      • Set the terminal window or tab title.

        This is an imperative side effect, not part of the render tree. Control characters are stripped from the title before writing the terminal sequence. Best effort only — some hosts may ignore it.

        Parameters

        • title: string

        Returns void

    • stop: function
      • Stop the framework and restore terminal state.

        Pops the Kitty keyboard protocol mode, disables bracketed paste and mouse tracking, and restores the terminal to its previous state.

        Returns void

    • viewport: function
      • Set the render function that returns the UI tree. Triggers the first render automatically.

        Parameters

        • fn: RenderFn

          A function that returns the current UI tree.

        Returns void

    import { cel, VStack, Text, ProcessTerminal } from "@cel-tui/core";

    cel.init(new ProcessTerminal());
    cel.viewport(() =>
    VStack({ height: "100%" }, [
    Text("Hello, world!", { bold: true }),
    ])
    );