Live Log Stream
motiq/live-log-streamFreeComponent
A live log viewer for developer surfaces (deploy/build output, jobs, server events): auto-follow that never fights the user's scroll, a "N new lines" resume indicator, pause/resume, search, per-level filtering, copy, clear, and bounded history. Levels are shown by icon + label + prefix, never colour alone. Display-only — the host app supplies the entries.
Live preview
live · rendered by the registry
Rendered by motiq on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.motiq.dev/r/live-log-stream.jsonSource
1"use client";23import * as React from "react";4import { motion, AnimatePresence } from "motion/react";56import { cn } from "@/lib/utils";7import {8 useReducedMotion,9 useVisibilityPause,10 useAutoFollow,11 formatTimestamp as defaultFormatTimestamp,12 streamItemVariants,13 statusVars,14 formatNumber,15 type StatusTone,16} from "@/lib/motiq";1718/**19 * LiveLogStream — a production log viewer for developer surfaces (deploy/build20 * output, background jobs, server events, local dev, queue workers).21 *22 * It is *presentation only*: the host application owns the `entries` array and23 * streams new lines in by appending to it. The component never opens a socket,24 * never fabricates output, and makes no claim about what a system is "doing".25 *26 * The defining UX is auto-follow that never fights the user (shared27 * `useAutoFollow`): while pinned to the bottom, new lines scroll into view;28 * scroll up (or pause) and following stops, new lines are counted, and a29 * "N new lines — jump to latest" control lets the reader resume on their terms.30 * User scrolling is never disabled. Levels are conveyed with an icon **and** a31 * text label/prefix — never colour alone — so they survive forced-colors and32 * assistive tech. Under `prefers-reduced-motion` new lines appear instantly.33 * Clean-room original.34 */3536export type LogLevel = "debug" | "info" | "success" | "warning" | "error";3738export interface LogEntry {39 /** Stable identifier, unique within the stream. */40 id: string | number;41 /** Severity — drives the icon, label, and prefix (never colour alone). */42 level: LogLevel;43 /** The log line. Long lines scroll horizontally rather than wrapping the row. */44 message: string;45 /** When the line was emitted. Absent lines simply omit the timestamp column. */46 timestamp?: Date | number | string;47 /** Optional origin tag, e.g. a service or worker name. */48 source?: string;49}5051/** Lifecycle of the stream, owned by the application. */52export type LogStreamStatus = "streaming" | "idle" | "completed" | "error";5354export interface LiveLogStreamProps {55 /** The log lines, controlled by the host application (append to stream). */56 entries: LogEntry[];57 /** Lifecycle state. `"streaming"` shows a live pulse; `"error"` shows a banner. */58 status?: LogStreamStatus;59 /** Message shown in the error banner when `status === "error"`. */60 errorMessage?: string;61 /** Whether the viewport auto-follows the tail. Controlled when provided. */62 follow?: boolean;63// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from motiq
All 100 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Streamactivity-stream | motiq | Components | Free | 1 dep | |
| Adaptive Safe-Zone Gridadaptive-safe-zone-grid | motiq | Components | Free | no deps | |
| Agent Run Timelineagent-run-timeline | motiq | Components | Free | 1 dep | |
| AI Response Streamai-response-stream | motiq | Components | Free | 1 dep | |
| Animated Accordionanimated-accordion | motiq | Components | Free | 2 deps | |
| Animated Buttonanimated-button | motiq | Components | Free | 1 dep | |
| Animated Dialoganimated-dialog | motiq | Components | Free | 2 deps | |
| Animated Gridanimated-grid | motiq | Components | Free | 2 deps |
