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.
$ pnpm registry:build[kinetic] Validating component registry exports...[kinetic] Compiled registry.json and llms.txtDone in 312ms.Customize
Installation
npx shadcn@latest add @kinetic/terminalUsage
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.
| Prop | Type | Default | Description |
|---|---|---|---|
output / isStreaming / autoScroll / onClear | string / boolean / boolean / () => void | "" / false / true / undefined | Log text, active streaming toggle, smart bottom auto-scroll, and clear action handler. |
animated / speed / blurPx / staggerMs | boolean / number / number / number | true / 0.45 / 8 / 95 | Controls 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).
| Prop | Type | Default | Description |
|---|---|---|---|
icon (TerminalTitle) | React.ReactNode | false | - | Custom title icon or false to omit. |
isStreaming / streamingLabel / idleLabel (TerminalStatus) | boolean / React.ReactNode / React.ReactNode | inherited / "Streaming" / undefined | Controls 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.
| Prop | Type | Default | Description |
|---|---|---|---|
value / onCopy / copyResetMs (TerminalCopyButton) | string / () => void / number | inherited / - / 1800 | Text override, copy callback, and checkmark reset timer (ms). |
onClear / variant / size | () => void / KineticButtonVariant / KineticButtonSize | inherited / "ghost" / "icon-xs" | Clear handler and Kinetic Button appearance options. |
TerminalContent
Scrollable log viewport animating newly appended lines via staggerReveal and blinking WAAPI cursor.
| Prop | Type | Default | Description |
|---|---|---|---|
output / isStreaming / autoScroll / cursor / emptyMessage | string / boolean / boolean / boolean | React.ReactNode / React.ReactNode | inherited / inherited / inherited / true / undefined | Viewport overrides for streamed output, blinking cursor, and empty state message. |