Cards & content / Code blocks

Install Command Tabs

Dark-blue rounded panel with three OS tabs (macOS active, Linux and Windows underlined) separated by dotted corner marks, a mono curl command, and a copy icon on the right.

Rebuilt from hermes-agent.nousresearch.com in the Electric Ultramarine Engraving style.

npx shadcn@latest add https://justyoink.it/r/electric-ultramarine-engraving/blocks/os-install-tabs-terminal.json

Looks exactly like hermes-agent.nousresearch.com: brings its fonts and colours, namespaced so your own theme stays untouched.

Usage

Props: `tabs` (array of {id,label,command}) and `label` (caption above the panel). Click a tab to swap the command; the copy icon copies it and shows a check for 1.5s.

components/os-install-tabs-terminal.tsx
import { useState } from "react";

type Tab = { id: string; label: string; command: string };

const DEFAULT_TABS: Tab[] = [
  { id: "mac", label: "macOS", command: "curl -fsSL https://example.dev/relay/install.sh | bash" },
  { id: "linux", label: "Linux", command: "wget -qO- https://example.dev/relay/install.sh | sh" },
  { id: "win", label: "Windows", command: "iwr https://example.dev/relay/install.ps1 -UseBasicParsing | iex" },
];

export default function InstallCommandTabs({ tabs = DEFAULT_TABS, label = "Install via terminal" }: { tabs?: Tab[]; label?: string }) {
  const [active, setActive] = useState(tabs[0]?.id);
  const [copied, setCopied] = useState(false);
  const current = tabs.find((t) => t.id === active) ?? tabs[0];

  const copy = async () => {
    try {
      await navigator.clipboard.writeText(current.command);
    } catch {}
    setCopied(true);
    setTimeout(() => setCopied(false), 1500);
  };

  return (
    <div className="w-full max-w-[450px] bg-cobalt p-4 font-mono text-paper">
      <p className="mb-4 text-[11px] uppercase tracking-wide">{label}</p>
      <div className="rounded-md bg-cobalt-shade p-1 shadow-subtle">
        <div role="tablist" className="grid grid-cols-3 gap-1">
          {tabs.map((t) => {
            const on = t.id === active;
            return (
              <button
                key={t.id}
                role="tab"
                aria-selected={on}
                onClick={() => setActive(t.id)}
                className={`relative h-[28px] rounded-sm text-[11px] transition-colors duration-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-paper ${on ? "bg-cobalt text-paper" : "text-paper/90 underline underline-offset-2 hover:bg-overlay-soft"}`}
              >
                <span aria-hidden className="absolute left-1 top-0 text-paper/50">:</span>
                {t.label}
                <span aria-hidden className="absolute right-1 bottom-0 text-paper/50">:</span>
              </button>
            );
          })}
        </div>
        <div className="flex items-center justify-between gap-3 px-3 py-3 text-[11px]">
          <code className="overflow-x-auto whitespace-nowrap">{current.command}</code>
          <button
            onClick={copy}
            aria-label={copied ? "Copied" : "Copy command"}
            className="shrink-0 rounded-sm p-1 hover:bg-overlay-soft focus-visible:outline focus-visible:outline-2 focus-visible:outline-paper"
          >
            {copied ? (
              <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M4 12l5 5L20 6" /></svg>
            ) : (
              <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><rect x="8" y="8" width="12" height="12" rx="1" /><path d="M16 8V4H4v12h4" /></svg>
            )}
          </button>
        </div>
      </div>
    </div>
  );
}

Quality checks

Automated, in a real browser · 5d ago
—

More from Electric Ultramarine Engraving

The whole style →

Numbered Engraving Feature Grid

Feature sections

Weathered Texture Compare Hero

Heroes

Cobalt Engraving Hero

Heroes

Spaced Mono Navigation Bar

Headers & nav bars

Condensed Uppercase Button Pair

Buttons

Muted Painting Terminal Video

Media & mockups