Skip to content

Log

A monospace log display container that supports incremental appending and "stick-to-bottom" auto-scrolling, suitable for consoles / build output scenarios.

Basic Usage

Basic log stream

Provide data via the lines property (or the lines attribute as a JSON string); when appending, only the new lines are rendered incrementally — existing nodes are not rebuilt.

Line Numbers

Show line numbers

Appending and Auto-Scroll

Appending log stream (stick-to-bottom auto-scroll)

Appends a log line every 1.2s; auto-scroll happens only when pinned to the bottom, and scrolling up to read history does not interrupt it.

Disabling Auto-Scroll

auto-scroll=false

With auto-scroll="false", appended content does not auto-scroll to the bottom.

Empty State

Empty log

An empty lines shows the empty-state placeholder; the copy follows the locale (overridable via empty-text).

Custom empty text

empty-text overrides the default empty-state copy (default: "No logs yet").

API

Attributes

AttributeDescriptionTypeDefault
auto-scrollAuto-scroll to bottom on append (only when stuck to the bottom)stringtrue
empty-textEmpty state text (overrides the locale default)
line-numberShow the left line number columnboolean
linesLog lines JSON string (attribute channel)string[][]

Parts: ::part(viewport) scroll viewport, ::part(log) log content, ::part(row) a single row, ::part(line-number) line number, ::part(line) line text, ::part(empty) empty state.