Calm motion: animations on this site only fade, with no movement
LogViewer
A live log with colors, a filter, and follow
Shows the output of a server, a build, or a job, as it comes in. Only the lines in view are in the page, so a log of many thousand lines stays fast. For code that people read, use a code block. For structured data, use the JSON viewer.
Basic
1Phoenix server started on port 4000
linesis the log, one string per line. Add lines to the end as they come in. Each line is read once, so a log that grows only reads its new lines.- ANSI colors (red, green, yellow, blue, magenta, cyan, and their bright forms), bold, dim, and underline are kept, and they follow the theme. Other escape codes, such as cursor moves, are dropped.
- Follow keeps the newest line in view. Scroll up to read, and follow turns off. Scroll to the end, or press Follow, and it turns on again.
v-model:followholds the state. - The filter shows the lines that contain its text, with no regard to case. The lines keep their numbers, and the bar says how many lines match.
- Each line is one row 20px high, and a long line scrolls to the side. It does not wrap.
- Set
heightfor the line area (default320px), andlabelto name the log for screen readers. - Change the words with
labelsor a label pack:filter,follow,empty, andcount(shown, total).
Usage
ts
import { BlessLogViewer } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
lines* | string[] | — | the log, one string per line; ANSI colors are kept, other escape codes dropped |
height | string | "320px" | CSS height of the line area |
label | string | "Log" | names the log for screen readers |
labels | Partial<{ filter: string; follow: string; empty: string; count: (shown: number, total: number) => string; }> | — | |
follow | boolean | true | keep the newest line in view; scrolling up turns it off, scrolling to the end turns it on |
Events
| Name | Payload | Description |
|---|---|---|
update:follow | [value: boolean] |