Skip to content
WunderUI

Log Stream

Pro

The timestamped lines a run writes, newest at the bottom, with an All or Errors filter and auto-scroll.

Playground

Run log

0:01.2InfoRun started: audit 122 component pages
0:02.1InfoChecked /components/alert-dialog
0:03.0InfoChecked /components/avatar
0:03.9DebugCache hit for the badge manifest
0:04.8InfoChecked /components/breadcrumb
0:05.7Warn/components/button took 4.1 s to render
0:06.6InfoChecked /components/card
0:07.5ErrorContrast 3.2:1 on /components/carousel (needs 4.5:1)

Installation

Log Stream comes with WunderUI Core and Pro, in the package from your plan. See the plans.

Then import what you need:

tsx
import { LogStream } from "@wunderui/react"

Then use it:

tsx
import { LogStream } from "@wunderui/react"

const LINES = [
  { id: "1", time: "0:01.4", level: "info", message: "Read 214 variables from Figma" },
  { id: "2", time: "0:05.2", level: "warn", message: "Figma API busy, retrying in 2 s" },
  { id: "3", time: "0:12.0", level: "error", message: "Push to docs-preview timed out" },
] as const

export function RunLog() {
  return <LogStream lines={[...LINES]} />
}

Expected result: You see a card titled Run log with All and Errors on the right, three lines with times, a Warn and an Error word, and Auto-scroll at the bottom. Press Errors and only the last line stays.

When to use

Use Log Stream for

  • The timestamped lines a run writes while it works, newest at the bottom
  • A log that keeps growing while the reader follows it, or reads back
  • Finding the failure in a long run with the Errors filter

Use something else for

  • Terminal Output for one command with its exit code and its output streams
  • Run Timeline for the steps of a run with their duration and result
  • Activity Item for one line per action, with a status, a tool and a time

Level

A line is debug, info, warn or error. Info shows only a grey dot, the others add the level word before the message, and screen readers hear every level, info included.

Run log

0:00.1InfoRun started: audit 122 component pages
0:03.2InfoChecked 40 of 122 pages
0:06.3InfoChecked 80 of 122 pages

Filter

All shows every line, Errors only the error lines, so a warning does not pass. To know what is shown, control the filter from the page.

Run log

0:00.0InfoRun started: sync 214 Figma variables
0:01.4InfoRead 214 variables from Figma
0:05.2WarnFigma API busy, retrying in 2 s
0:09.8InfoBound 96 of 214 variables
0:12.0ErrorPush to docs-preview timed out after 30 s
0:12.1ErrorRun failed at step 4 of 6. 118 variables were not bound.

Auto-scroll

While Auto-scroll is on, every new line pulls the view to the bottom; turn it off to read back while the log keeps growing below. It does not switch off by itself when the reader scrolls.

Run log

0:01.2InfoRun started: audit 122 component pages
0:02.4InfoChecked /components/alert-dialog
0:03.6InfoChecked /components/avatar
0:04.8DebugCache hit for the badge manifest
0:06.0InfoChecked /components/breadcrumb
0:07.2Warn/components/button took 4.1 s to render
0:08.4InfoChecked /components/card
0:09.6ErrorContrast 3.2:1 on /components/carousel (needs 4.5:1)

Empty

An empty log says so, and a filter that leaves nothing says that. Both messages sit inside the log region, and you can replace them.

Run log

Nothing logged yet.

Line

The time column is 46 px wide, so keep it to run times like 0:02.9 or clock times like 14:02:11. The message wraps.

Run log

0:02.9InfoRead 214 variables from Figma

Keyboard interactions

The filter and Auto-scroll are native buttons. The log is a focusable scroll region, so the usual scroll keys work.

TaborShiftTab
Moves focus through All, Errors, the log and Auto-scroll, in that order. Focus shows as an indigo ring.
EnterorSpace
On All or Errors: shows that set of lines. On Auto-scroll: turns it on or off. follows.
ArrowDownorArrowUp
In the focused log: scrolls it by a line.
PageDownorPageUp
In the focused log: scrolls it by a page.
HomeorEnd
In the focused log: jumps to the oldest or the newest line.

Behavior and motion

What the log does with its lines, the filter, scrolling, assistive technology and motion.

Lines
Every line you pass is rendered in order, newest last. The array is the whole log, and each line needs an id so rows keep their identity.
Limits
There is no cap and no virtualisation: each line is a DOM node. Keep the newest 200 to 500 lines in your own buffer; the log still scrolls to the newest one.
Filter
All shows every line, Errors only error lines (a warning does not pass). The filter never changes your lines, and there is no search, so filter first.
Auto-scroll
While on, each new array of lines and each filter change scrolls to the bottom. It does not notice the reader, so scrolling up gets pulled back by the next line unless you turn it off.
Live region
The log is a polite live region, so added lines are read after the current speech: time, level word and message. Removed lines are not read.
Empty
With no lines, or none that pass the filter, the log says Nothing logged yet or No errors so far. An empty label prop replaces both.
Failure
The log has no state for a failed, stopped or dropped stream. Add a final error or warn line and say it in text next to the log.
States
Filter buttons tint on hover and when pressed, and Auto-scroll darkens its text on hover. Buttons and the log show an indigo ring on keyboard focus.
Motion
The component has no animation. Lines appear at once and the view jumps to the bottom; buttons change colour quickly.
Reduced motion
Nothing moves, so there is nothing to reduce. With reduced motion only the colour changes remain, and they carry no meaning by themselves.

Anatomy

The figure marks a log with a failed run. Time, level and message are the three parts of every line and have no number of their own.

Run log

0:00.0InfoRun started: sync 214 Figma variables
0:01.4InfoRead 214 variables from Figma
0:05.2WarnFigma API busy, retrying in 2 s
0:09.8InfoBound 96 of 214 variables
0:12.0ErrorPush to docs-preview timed out after 30 s
0:12.1ErrorRun failed at step 4 of 6. 118 variables were not bound.
  • data-slot="log-stream"

    A section named by its title with a 1 px border and 16 px radius: title and filter in a row, the log, and the Auto-scroll toggle.

  • The title (Run log by default) in one line of 15 px semibold text. It names the section and the log.

  • A group named Show with two toggle buttons, All and Errors. Control the level yourself or let the component keep it.

  • The scrolling region: a live log named by the title that a keyboard can scroll. It stops growing at the maximum height, 240 px by default.

  • Optional

    One row with the time, a level dot, the level word and the message. Give each line an id; without one, rows are keyed by position.

  • The time of the line, already formatted, in 11 px tabular numbers in a 46 px column.

  • A 6 px dot and the level word. Debug, warn and error show the word, info hides it visually, and screen readers read it for every level.

  • The message in 13 px text, using the free width. It wraps and breaks long words.

  • A button with a pin icon, on by default. Control it yourself or let the component keep the state.

Best practices

  • Do

    Pass the time already formatted and short, such as 0:02.9 or 14:02:11, and give every line a stable id. The time column is 46 px wide.

  • Do

    Cap the array to the newest 200 to 500 lines and create a new array only when a line arrives. The log renders every line and does not virtualise.

  • Do

    Mark failed lines with the error level. The Errors filter shows only those, and an empty result reads No errors so far.

  • Do

    Say how the stream ended, in a line and in text next to the log: failure, stop or dropped connection. A stalled log looks like a quiet one.

  • Do

    Give every Log Stream on a page its own title. Two landmarks with the same name cannot be told apart.

  • Do

    Control auto-scroll when readers should be left alone while reading back. The log never turns it off by itself.

  • Don’t

    Don't append lines faster than a person can read. A polite live region queues announcements, so batch one second of lines into one.

  • Don’t

    Don't pass HTML strings or untrusted markup as a message. Log lines come from tools and files, so render them as text.

  • Don’t

    Don't expect search, copy or a line cap from the component. They belong to the page around it, as the Examples tab shows.

API reference

LogStream is a plain component, so this table lists every prop.

A section named by its title with a 1 px border and 16 px radius: title and filter in a row, the log, and the Auto-scroll toggle.

PropTypeDefaultDescription
lines requiredLogLine[]—The lines, oldest first. Each has a (already formatted), a (text or parts), an optional (, , , ; default ) and an optional used as the row key.
titleReactNode"Run log"The heading of the card and the name of the log region. Default .
level"all" | "errors"—Controlled filter, or . Pass it with ; without it the filter keeps its own state.
defaultLevel"all" | "errors""all"The filter the log starts with when it is not controlled. Default .
onLevelChange(level) => void—Called with or when a filter button is pressed, controlled or not.
autoScrollboolean—Controlled Auto-scroll. Pass it with , for example to turn it off when the reader scrolls up.
defaultAutoScrollbooleantrueWhether Auto-scroll starts on when it is not controlled. Default .
onAutoScrollChange(autoScroll) => void—Called with the new value when the Auto-scroll button is pressed, controlled or not. It is not called when the log scrolls.
maxHeightnumber240The height in px after which the log scrolls. Default .
emptyLabelReactNode—Shown when no line passes the filter, in place of and
classNamestring—Extra classes for the card, for example a width.

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

MCPget_component("log-stream")
InstallIncluded in Core and Pro

The full library index for assistants is at /llms.txt.