Metamorph

Copy Morph

A copy button where the two sheets flow into a check.

Preview

Installation

Terminal
npx @usefluid/cli add copy-morph

Usage

CopyMorph.tsx
import { CopyMorph } from "./CopyMorph";

<CopyMorph text="npm i @usefluid/motion" />

API reference

PropTypeDefaultDescription
textstring—What goes to the clipboard.
labelstring"Copy"Accessible name.
doneLabelstring"Copied"Announced after copying.
doneboolean—Force the copied state, for showcases.

Keyboard and screen readers

A real button; the result is announced.

Notes

Needs a secure context (https or localhost) for the clipboard.

Every colour comes from the --fluid-* variables, and the piece is yours to change.

How it is made

The icon is a contour of the engine: the two sheets become a check, one of them shrinking away. The pill's width follows the new word on a spring. The word is announced to screen readers, and after a moment everything goes back.

For your agent

For your agent

Add Copy Morph to my project with the Fluid library. Use CopyMorph wherever people copy codes, links or keys in my product. Read my project first. Use my logo, my colours and my font through the --fluid-* variables. Keep 44px touch targets, visible focus and reduced motion. If I have no SVG logo, ask before making one up.