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.
npx shadcn@latest add https://yoink-app.fly.dev/r/warm-paper-editorial/mine/install-command-chip.json
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
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> ); }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-muted py-[10px] pl-[10px] pr-[10px] ${className}`} > <code className="block min-w-0 flex-1 overflow-hidden whitespace-nowrap font-mono text-warm-ui text-foreground"> {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-muted" /> <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-full bg-foreground text-card transition-opacity duration-warm-hover-color ease-warm-hover-color hover:opacity-80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground" > {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- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: passedStill readable when installed in your theme and switched to dark mode.
- Themeable: passedUses design tokens rather than hard-coded colours, so it follows your theme cleanly.
- Animates cleanly: doesn't applyDoesn't animate, so there's nothing to check.