LogPanel#

A bounded tail of recent log lines — the non-scrolling companion to LogView. Shows the last height lines of a LogStore (or static lines).

Import#

TSX
import { LogPanel, createLogStore } from '@sigx/terminal';

Usage#

TSX
/** @jsxImportSource @sigx/terminal */
import { component, defineApp, onMounted, LogPanel, createLogStore } from '@sigx/terminal';

const App = component(() => {
    const log = createLogStore();
    onMounted(() => {
        let n = 0;
        const t = setInterval(() => { log.push(`event ${++n}\n`); }, 300);
        return () => clearInterval(t);
    });
    return () => (
        <box>
            <LogPanel store={log} height={5} title="recent" variant="panel" color="dim" />
        </box>
    );
});

defineApp(<App />).mount({ clearConsole: true });

Props#

PropTypeNotes
storeLogStorethe reactive source
linesstring[]static lines (alternative to store)
heightnumbernumber of tail lines to show
widthnumberwrap width
titlestringcaption
variant'bar' | 'plain' | 'panel'chrome style
colortoken | #hextext color

See also#

  • LogView — a scrollable viewport and the LogStore API.
  • TaskList — task status with a streamed tail.