Joe Mahoney

Terminal Window

Component

About

macOS-style terminal window with tabs and copy button

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Terminal Window to your project and fits it to your theme.

Code

How Terminal Window is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import React from "react";
import { TerminalWindow } from "@/components/ui/terminal-window";

const INSTALL_LOG = `$ npm i -g @21st-dev/cli
added 1 package in 649ms
$ 21st whoami
multicloudmahoney
$ 21st publish ./terminal-window.tsx --description "macOS-style terminal window"
Build passed. Opening CLI Review…`;

const JSON_OUTPUT = `{
  "component_id": 123,
  "url": "https://21st.dev/m/multicloudmahoney/terminal-window",
  "install_ref": "multicloudmahoney/terminal-window",
  "demos": ["default"],
  "media": { "cover": "ready", "video": "ready" }
}`;

export default function TerminalWindowDemo() {
  return (
    <div className="w-full bg-zinc-100 p-6 dark:bg-zinc-100 sm:p-10">
      <div className="mx-auto max-w-3xl space-y-6">
        <TerminalWindow
          title="deploy — Live Output"
          statusBadge="BUILD PASS"
          tabs={[
            {
              id: "install",
              label: "Install",
              language: "bash",
              code: INSTALL_LOG,
            },
            {
              id: "result",
              label: "Result",
              badge: "json",
              language: "json",
              code: JSON_OUTPUT,
            },
          ]}
        />
        <TerminalWindow
          title="notes.txt"
          subtitle="PLAIN CONTENT"
          content={"Copy button, tab switching, and scrolling all work out of the box.\nPass `content` for a single pane, or `tabs` for a tabbed inspector."}
        />
      </div>
    </div>
  );
}

Dependencies

Explore more