Honest errors
Every failure is a typed, classified error: permission denied, insecure page, too large, not supported. Nothing silently no-ops.
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.
npm install react-smart-copyimport { 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.