This component no longer exists. It was in ns-ui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-07 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
Copy Button Travel
ns-ui/copy-button-travelRemovedComponent
Copy-to-clipboard button whose confirmation shows what got copied: a duplicate of the source text visibly peels off the line and travels the real distance to the clipboard glyph before fading, arriving as the glyph gives a small catch-bounce and the label ticks to "Copied".
Live preview
live · rendered by the registry
Rendered by ns-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://design.helpmarq.com/r/copy-button-travel.jsonSource
1"use client";23import { useCallback, useEffect, useRef, useState } from "react";45// ---------------------------------------------------------------------------6// CarbonLift — a copy-to-clipboard button that shows WHAT it copied, not just7// that something happened. On click, a duplicate of the source text peels up8// off the source line and travels most of the real distance to the button's9// clipboard glyph over 720ms — the actual measured gap between source and10// icon, not a token nudge — fading and tightening its letter-spacing as it11// goes, arriving right as the glyph gives one small settle bounce, as if it12// just "caught" the duplicate. The label ticks Copy -> Copied in Geist Mono13// at the same moment. This is a duplicate rising UP and traveling with the14// real content as the moving element — distinct from a stamp pressing an15// impression DOWN.16//17// MECHANISM: on click, the visible source node and the button's icon are18// measured with getBoundingClientRect(); a clone span is absolutely19// positioned at the source's exact box (same font, --foreground) inside a20// shared relative container, then animated via a CSS custom property21// translate + opacity + letter-spacing over 720ms ease-out-expo: it holds22// near-full opacity through the first half of the flight so the two-line23// duplication actually registers, then fades over the second half as it24// nears the glyph. If the source is scrolled off-screen the measurement is25// skipped and the component falls back to a plain label swap — the same26// thing reduced motion always does.27//28// A11Y: a real <button> with an aria-label naming exactly what it copies.29// Success is announced through a visually-hidden aria-live=polite region30// ("Copied to clipboard"); the flying duplicate is aria-hidden and purely31// decorative — nothing here is conveyed only by animation. Enter/Space32// behave identically to a click (native button semantics, no custom key33// handling needed). The label + icon revert to the resting state after 2s.34//35// Tokens only: --foreground for ink and the ghost, --muted for secondary36// text, --border for the frame, --accent for the keyboard focus ring only.37// Pure DOM/SVG/CSS — no canvas.38// ---------------------------------------------------------------------------3940const GHOST_MS = 720;41const BOUNCE_MS = 260;42// The glyph's settle bounce should land as the duplicate arrives, not43// partway through its flight — so its delay is derived from the flight44// … truncated
