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
| Attribute | Description | Type | Default |
|---|---|---|---|
auto-scroll | Auto-scroll to bottom on append (only when stuck to the bottom) | string | true |
empty-text | Empty state text (overrides the locale default) | — | — |
line-number | Show the left line number column | boolean | — |
lines | Log 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.