Skip to content

Copy is an interaction. Treat it like one.

Headless React primitives for the whole clipboard moment. Copying, pasting, Ctrl/Cmd+C, drag-and-drop, spreadsheet ranges, Markdown, code, private images, links, colours and rich text. Honest errors, no flicker, accessible by default.
Order reference
PLT-29018

Copy the reference. The top row is the real state machine; the bottom row is what users see. Turn on the slow adapter to watch "Copying…" earn its place.

Terminal window
npm install react-smart-copy
import { CopyField } from 'react-smart-copy';
export function ContactRow() {
return (
<CopyField.Root value="shubh@example.com" label="Email">
<CopyField.Label />
<CopyField.Value />
<CopyField.Trigger>
{({ displayStatus }) =>
displayStatus === 'copied' ? 'Copied' : displayStatus === 'error' ? 'Retry' : 'Copy'}
</CopyField.Trigger>
</CopyField.Root>
);
}

Honest errors

Every failure is a typed, classified error: permission denied, insecure page, too large, not supported. Nothing silently no-ops.

Accessible by default

Screen-reader announcements, focus and keyboard handling built in, and checked with axe in Chromium, Firefox and WebKit.

Small and headless

About 3.5 kB for useCopy, no runtime dependencies, and no styles: it fits Tailwind, CSS modules, shadcn, MUI or your own design system.

Safe everywhere

Server-render safe, React 18 and 19, StrictMode-proof. Pasted HTML is parsed inert, and pasted photos lose the location they were taken at.