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

Install commands are on Home, attached from the registry - they are not written here, because a second copy is a copy that goes stale. This tab starts after the install worked.

Use it

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

export function Example() {
	return (
		<code className="code">
			pnpm add @sushindustries/ui
			<CopyButton text="pnpm add @sushindustries/ui" ground="paper" />
		</code>
	);
}
tsx

What you should see

A glass chip reading "Copy" with a copy glyph. Click it and the glyph swaps to a tick, the label reads "Copied", and after two seconds it hands back to the resting state on its own - no toast, no second element appearing anywhere else on the page.

If nothing happens

If clicking never shows "Copied", the page is not in a secure context (plain HTTP rather than HTTPS or localhost) - navigator.clipboard does not exist there, and the button treats that the same as a denied permission: it fails silently rather than throwing, so check the browser console is quiet, not loud, before assuming this is broken.

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