# Chain Copy

A copy-link button whose chain icon snaps apart when pressed, flings two chips from the break, then swings back together and relinks as the label rolls to Copied.

- Page and source: https://uibrik.com/components/chain-copy
- Install: `npx shadcn@latest add https://uibrik.com/r/chain-copy.json`
- Packages (installed by the CLI): motion, react-use-measure
- Import: `import { ChainCopy } from "@/components/uibrik/chain-copy/chain-copy"`

Where to use the Chain Copy React component:

- **Share links**: The chain breaking and relinking says a link was taken, not just any text. Pairs with [Share Menu](https://uibrik.com/components/share-menu) and [Popover](https://uibrik.com/components/popover).
- **Invite links**: Team invites and referral links get a copy action people notice. Pairs with [Invite Members](https://uibrik.com/components/invite-members).
- **Docs anchors**: Heading permalinks copy with a small, satisfying beat.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| label | `string` | `"Copy link"` | Button text. |
| copiedLabel | `string` | `"Copied"` |  |
| text | `string` | `"https://example.com/invite/8f3k2"` | Text written to the clipboard. Leave out to copy the page URL. |
| display | `"label" \| "icon"` | `"label"` | Show the label, or the icon alone. |
| variant | `"soft" \| "ghost" \| "solid"` | `"soft"` | Button look. |
| size | `"sm" \| "md" \| "lg"` | `"md"` | Height, padding and text size. |
| successColor | `string` | `"#16a34a"` | Colour of the relinked chain and label. |
| resetAfter | `number` | `1.6` | How long Copied stays. |
| radius | `number` | `12` | Corner radius. |
| onCopy | `(text: string) => void` |  | Called after a successful copy. |
| className | `string` |  | Classes for the button. |
