Copy Button

@sushindustries/ui

A glass chip that writes to the clipboard and confirms in the button itself.

Last updated Aug 17, 20265 min read
View as MarkdownEdit on GitHub

Examples are the tab where the component is shown doing a job, not demonstrating a prop. The API tab already lists the props.

Viewport width
Phone22remthe floor, the narrowest this promises to work at
tanstacktanstack add https://adamjurek.com/r/tanstack/copy-button.jsonshadcnpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/copy-button.json

Press Compare. The frames are real viewports, so a layout that breaks at 320 breaks here too rather than in somebody's hands.

In a page

import { CopyButton } from "@sushindustries/ui";

export function ApiKeyRow({ value }: { value: string }) {
	return (
		<div className="flex items-center justify-between gap-3">
			<code className="mono text-sm">{value.slice(0, 8)}…</code>
			<CopyButton text={value} label="Copy key" ground="paper" />
		</div>
	);
}
tsx

What this example is not

Not a masked-value component. The truncated display is for reading; the full value still goes to the clipboard on click, which is the point - do not reuse this pattern somewhere the truncated text is the only thing that should ever leave the row.

UsesIconIconThe glyph set, generated from a Markdown table where every drawing carries its reason. One component, typed names, no icon font.@sushindustries/ui · content
Used byCode BlockCode BlockA highlighted code slab with the CLI's colours, a lit top edge, and a copy button that confirms in place.@sushindustries/ui · contentSecret RevealSecret RevealA credential shown once: it wraps rather than scrolls, one click selects all of it, and the copy button sits under it rather than over it.@sushindustries/ui · contentShowcaseShowcaseA component in a real iframe at every width it has to survive, side by side, with its source and install commands.@sushindustries/ui · docs
Mentioned inCode Block