Cards & content / Code blocks

Terminal Install Chip

Mono-font command on a sunken rounded bar with a dark circular copy button at the right edge; text truncates under the button.

Rebuilt from cursor.com in the Warm Paper Editorial style.

npx shadcn@latest add https://yoink-app.fly.dev/r/warm-paper-editorial/blocks/install-command-chip.json

Looks exactly like cursor.com: brings its fonts and colours, namespaced so your own theme stays untouched.

Usage

Props: command (text shown and copied), label (aria-label for the button), className. Clicking the dark round button copies the command and briefly shows a check mark.

components/install-command-chip.tsx
import { useState } from "react";

type Props = {
  command?: string;
  label?: string;
  className?: string;
};

export default function TerminalInstallChip({
  command = "curl https://example.dev/install -fsS | bash",
  label = "Copy install command",
  className = "",
}: Props) {
  const [copied, setCopied] = useState(false);

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

  return (
    <div
      className={`relative flex w-full max-w-[383px] items-center rounded-md bg-surface-sunken py-[10px] pl-[10px] pr-[10px] ${className}`}
    >
      <code className="block min-w-0 flex-1 overflow-hidden whitespace-nowrap font-mono text-ui text-ink">
        {command}
      </code>
      <div className="pointer-events-none absolute inset-y-0 right-0 w-24 rounded-r-md bg-gradient-to-r from-transparent to-surface-sunken" />
      <button
        type="button"
        onClick={copy}
        aria-label={copied ? "Copied" : label}
        className="relative z-10 ml-2 flex h-6 w-9 shrink-0 items-center justify-center rounded-pill bg-ink text-surface transition-opacity duration-hover-color ease-hover-color hover:opacity-80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink"
      >
        {copied ? (
          <svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
            <path d="M3 8.5l3.2 3L13 4.5" />
          </svg>
        ) : (
          <svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.4" strokeLinejoin="round" aria-hidden="true">
            <rect x="5.5" y="5.5" width="8" height="8" rx="1.5" />
            <path d="M10.5 3.5v-.5a1 1 0 0 0-1-1H3.5a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h.5" />
          </svg>
        )}
      </button>
    </div>
  );
}

Quality checks

Automated, in a real browser · 4d ago
—

More from Warm Paper Editorial

The whole style →

Ink and Ghost Pill Buttons

Buttons

Quote Card Grid

Testimonials

Dated Blog Index Table

Lists

Customer Story Logo Cards

Cards

Hairline Chevron Accordion

FAQ

Centered Pull Quote

Text effects