# Log stream

A live log printed on a strip of paper tape. Each line is a time, a printed legend for its level (debug, info, warn, error) and its words, set between the sprocket holes of the tape. A lamp in the head says whether the tape is following the newest line (green, Following) or has been left where you are reading (amber, Paused, and how many lines have come since); a key jumps back to the latest. Over the tape sits a filter well: a search field and the four levels as chips. It is a display: it prints what the page gives it, keeps the last thousand lines and runs nothing.

Kit part · With the Kit · https://tactileui.dev/parts/log-stream

> The code and styling for this part come with the Tactile UI Kit, which is in the Founder Pass. Sign in if you have it. Sign in: https://tactileui.dev/auth/sign-in The price: https://tactileui.dev/pricing

## Anatomy

Thermal paper cut by a strip of sprocket holes down each edge, drawn as two repeating gradients that scroll with the text, read through a window whose upper wall casts a shadow on it. The head’s lamp is the kit’s, the filter is the kit’s search field and chip group, and the lines are the terminal’s idea in ink: a grid of time, legend and text. About a hundred and fifty lines of script, most of it keeping the tape where you left it.

## Variants

- With lines
- Empty · waiting for the first line
- A taller tape
- Lines that wrap
- Keeps the last five lines

## States

- Debug
- Info
- Warn
- Error

## Props and options

| Name | Kind | Description |
| - | - | - |
| clear() | method | Empties the tape and goes back to following. |
| lines · shown · following · tape | property | How many lines it holds, how many show under the filter, whether it is following, and the log element. |
| logLevel() · logTime() · logMatch() · logDrop() · logCountText() · logLineHTML() · logStreamHTML() | function | The level a name means, the time as HH:MM:SS, whether a line passes a filter, how many old lines to drop, the count in words and the markup of a line and of the whole log. |

## Usage notes

Press Start the feed: lines arrive and the tape follows. Scroll up inside the tape: the lamp turns amber and counts what has come since, and the tape stops moving under you. Press Jump to latest, or scroll to the bottom, and it follows again. Type in the filter well or switch a level off: the lines are kept, only not shown.

## Accessibility

- It is a stop of its own, so the keyboard can scroll it. A line the filter hides is removed from the page and is not read.
- A level is never a colour. Each line carries the word (debug, info, warn, error) in a plate whose shape says it as well: dashed, plain, double-ruled or filled. The tape is ink on paper in every finish; the only colour in the part is the follow lamp, and it always sits beside its words.
- It follows the newest line only while you are at the bottom. Scroll up to read and it lets go, says “Paused” once, and counts the lines that arrive without moving you; trimming the oldest lines past the cap never makes what you are reading jump.
- The filter is a labelled search field and four native checkboxes in a labelled group, so it has its own keys and its own arrows. After a change it says how many lines are showing, once, politely. The counts on the screen are hidden from a screen reader so they are not read at every line.

## Related parts

- [Terminal](https://tactileui.dev/parts/terminal): A command prompt on dark glass. It is a display, not a shell: it prints what the page gives it, line by line, and keeps a scrollback to read back through. A bar along the top names it and carries one lamp, white while it waits and amber while lines are still arriving. Each line has a mark in its margin that says what it is (a command, a success, a warning or a failure), so a kind is never only a colour, and at the foot a block cursor waits at a prompt that does nothing. Under reduced motion every line arrives whole.
- [Search field](https://tactileui.dev/parts/search-field): A recess for a question. A glass is printed on its floor at the start, the words run on, an optional count is printed behind an engraved line, and a clear key sits in the far corner while there is something to clear. Escape empties it.
- [Chip group](https://tactileui.dev/parts/chip-group): Small plates you press on and off, laid in a tray that wraps: the filters over a table, the topics on a form, the sizes on a product. Each chip is a native checkbox, or a radio when only one may be down, drawn as a small cap that sinks below the tray with its lamp lit. A limit may be set on how many go down at once.
- [Log pad](https://tactileui.dev/parts/log-pad): A writing pad that is still a real textarea. A sheet of ruled paper is set into a machined frame, and the rules move with the words. A small LCD in the foot counts characters or words: it lights amber near the limit and red over it, and the limit is said once, in words, when it is crossed. The pad grows with the text up to a height you choose.
