Molecules · Log feed
Log feed
A short, read-only list of recent events in the data font: "01 name → detail", the newest line bright and the older ones at rest, with an optional prompt line on top.
- Best for
- Showing the last few things that happened, such as recent sync events beside a dashboard panel.
- Not for
- A live shell session: use Terminal. Notifications people act on: use a List of ListItems.
This page as Markdown, a plain-text copy for a coding agent (an AI tool that writes code).
Examples
Recent events
- 01syncpulled 12 orders
- 02stockNorth depot below 40
- 03exportwrote stock-2026-11.csv
- 04labelprinted 8 shipping labels
Code
tsx
const EVENTS = [ { name: 'sync', detail: 'pulled 12 orders' }, { name: 'stock', detail: 'North depot below 40' }, { name: 'export', detail: 'wrote stock-2026-11.csv' }, { name: 'label', detail: 'printed 8 shipping labels' },]<div className="w-full max-w-md"> <LogFeed label="Recent events" entries={EVENTS} /></div>With a prompt line, numbered from 41
watch orders --site north
- 41syncpulled 12 orders
- 42stockNorth depot below 40
Code
tsx
const EVENTS = [ { name: 'sync', detail: 'pulled 12 orders' }, { name: 'stock', detail: 'North depot below 40' }, { name: 'export', detail: 'wrote stock-2026-11.csv' }, { name: 'label', detail: 'printed 8 shipping labels' },]<div className="w-full max-w-md"> <LogFeed label="Order watch" prompt="watch orders --site north" entries={EVENTS.slice(0, 2)} start={41} /></div>Anatomy
| Part | What it is |
|---|---|
| Log region | A div with role="log", named by label, so new lines are announced politely. |
| Prompt | Optional. A ">" then the prompt text and a block caret, which pulses only without reduced motion. |
| Entries | A numbered ordered list. The newest line is text.active; older lines text.rest; numbers text.muted. |
Props
- labelstring
- Required. Names the log region.
- entries{ name: ReactNode; detail?: ReactNode }[]
- Required. Oldest first; the last one is the newest.
- promptReactNode
- A line above the entries, followed by a caret.
- startnumberDefault 1
- The number of the first entry.
- classNamestring
- Merged with the component's classes.
- refRef<HTMLDivElement>
- Passed through to the log div.
Keyboard
You can't reach this component with the keyboard. It has no keyboard behaviour of its own.
Do and don't
Do
- Keep it to the last 5 to 10 entries.
- Write the name as the thing that acted and the detail as what it did.
Don't
- Don’t put actions in it: it is read-only.
- Don’t use it for prose. Long text belongs in the body font.