Skip to main content

Terminal

A streaming command console built on Kinetic Button with staggered blur-fade lines, blinking cursor, auto-height spring viewport, blur-dissolve clear, smart auto-scroll, and stroke-drawn copy feedback.

@heroicons/react
kinetic-cli
$ pnpm registry:build[kinetic] Validating component registry exports...[kinetic] Compiled registry.json and llms.txtDone in 312ms.

Customize

Speed0.45
Blur reveal (px)8
Line stagger (ms)95

Installation

npx shadcn@latest add @kinetic/terminal

Usage

Compose Terminal, TerminalHeader, TerminalTitle, TerminalStatus, TerminalActions, TerminalCopyButton, TerminalClearButton, and TerminalContent.

import {
  Terminal,
  TerminalActions,
  TerminalClearButton,
  TerminalContent,
  TerminalCopyButton,
  TerminalHeader,
  TerminalStatus,
  TerminalTitle,
} from "@/components/kinetic/ui/terminal";

const BUILD_LOG = [
  "$ pnpm registry:build",
  "[registry] Validated 150 items across catalog and UI specs",
  "[registry] Wrote public/r/*.json and llms.txt",
].join("\n");

export function BuildTerminal() {
  return (
    <Terminal output={BUILD_LOG} isStreaming={false}>
      <TerminalHeader>
        <TerminalTitle>pnpm build</TerminalTitle>
        <div className="flex items-center gap-2">
          <TerminalStatus />
          <TerminalActions>
            <TerminalCopyButton />
            <TerminalClearButton />
          </TerminalActions>
        </div>
      </TerminalHeader>
      <TerminalContent emptyMessage="Waiting for command output..." />
    </Terminal>
  );
}

Streaming lines and smart auto-scroll

When isStreaming is active, TerminalStatus appears and swaps labels via directionalSwap (staying hidden when idle unless idleLabel is explicitly provided), while TerminalContent sizes smoothly with useAnimatedSize, appends new lines with blur-fade staggerReveal, and dissolves cleared logs via WAAPI before emptying. Scrolling up pauses automatic scrolling until the viewport returns within 24 px of the bottom.

"use client";

import { useState } from "react";
import {
  Terminal,
  TerminalActions,
  TerminalClearButton,
  TerminalContent,
  TerminalCopyButton,
  TerminalHeader,
  TerminalStatus,
  TerminalTitle,
} from "@/components/kinetic/ui/terminal";

interface StreamingConsoleProps {
  readonly title: string;
  readonly lines: readonly string[];
  readonly streaming: boolean;
}

export function StreamingConsole({ title, lines, streaming }: StreamingConsoleProps) {
  const [cleared, setCleared] = useState(false);
  const output = cleared ? "" : lines.join("\n");

  return (
    <Terminal
      output={output}
      isStreaming={streaming}
      autoScroll
      onClear={() => setCleared(true)}
    >
      <TerminalHeader>
        <TerminalTitle>{title}</TerminalTitle>
        <div className="flex items-center gap-2">
          <TerminalStatus streamingLabel="Running" />
          <TerminalActions>
            <TerminalCopyButton />
            <TerminalClearButton />
          </TerminalActions>
        </div>
      </TerminalHeader>
      <TerminalContent cursor={streaming} emptyMessage="Output cleared." />
    </Terminal>
  );
}

Motion preferences

Terminal defaults to speed={0.45}, blurPx={8}, and staggerMs={95}. Under reduced motion, blinking cursors, auto-height springs, blur-dissolve clears, directional swaps, and line stagger animations settle immediately while copy and clear actions remain interactive.

API Reference

Terminal

Zero-dependency streaming terminal console sharing output state, auto-scroll, and kinetic motion tuning.

PropTypeDefaultDescription
output / isStreaming / autoScroll / onClearstring / boolean / boolean / () => void"" / false / true / undefinedLog text, active streaming toggle, smart bottom auto-scroll, and clear action handler.
animated / speed / blurPx / staggerMsboolean / number / number / numbertrue / 0.45 / 8 / 95Controls WAAPI/stagger motion, timing speed, blur radius (px), and line stagger delay (ms).

TerminalHeader / TerminalTitle / TerminalStatus / TerminalActions

Console header bar with directionalSwap TerminalStatus label (hidden while idle unless idleLabel is set).

PropTypeDefaultDescription
icon (TerminalTitle)React.ReactNode | false-Custom title icon or false to omit.
isStreaming / streamingLabel / idleLabel (TerminalStatus)boolean / React.ReactNode / React.ReactNodeinherited / "Streaming" / undefinedControls active indicator and status copy; renders nothing while idle unless idleLabel is passed.

TerminalCopyButton / TerminalClearButton

Kinetic Button toolbar controls featuring directionalSwap and drawStroke checkmark confirmation.

PropTypeDefaultDescription
value / onCopy / copyResetMs (TerminalCopyButton)string / () => void / numberinherited / - / 1800Text override, copy callback, and checkmark reset timer (ms).
onClear / variant / size() => void / KineticButtonVariant / KineticButtonSizeinherited / "ghost" / "icon-xs"Clear handler and Kinetic Button appearance options.

TerminalContent

Scrollable log viewport animating newly appended lines via staggerReveal and blinking WAAPI cursor.

PropTypeDefaultDescription
output / isStreaming / autoScroll / cursor / emptyMessagestring / boolean / boolean / boolean | React.ReactNode / React.ReactNodeinherited / inherited / inherited / true / undefinedViewport overrides for streamed output, blinking cursor, and empty state message.