Lazy-ui
Lazy-ui
registry components
DocsComponentsBlocksChangelog
GitHub0Install
Navigation11 groups
Get StartedDocs
  • Introduction
  • Installation
  • Changelog
  • All Components
Background13 items
  • Wave CipherNew
  • Horizon CipherNew
  • Orbit CipherNew
  • Orbit BloomNew
  • Orbit MeshNew
  • Aurora MeshNew
  • Chroma FlowNew
  • Prism DriftNew
  • Shadow MeshNew
  • Slime BackgroundNew
  • NeumorphismNew
  • Ripple SurfaceNew
  • Liquid ChromeNew
Text Animate7 items
  • Shiny Text
  • Text WarpNew
  • Text RiseNew
  • Text SpinNew
  • Text ScrambleNew
  • Spinning TextNew
  • Text FlipNew
Animate6 items
  • Counter
  • Liquid RevealNew
  • Liquid TransitionNew
  • Matrix GridNew
  • Particle HaloNew
  • Bling TransitionNew
Effects2 items
  • Reveal Animate
  • Circle CipherNew
Forms2 items
  • Switch
  • Checkbox
Buttons3 items
  • Copy Button
  • GitHub Stars Button
  • Glass ButtonNew
Feedback1 item
  • Progress
Navigation1 item
  • Animated Tabs
Overlay1 item
  • Animate Tooltip
Device Mocks1 item
  • iPhoneNew

Copy Button

A clipboard button with animated icon swaps, optional labels, and tooltip text.

copy-button
0px

Customize

Edit props; preview updates instantly.

Customize
Text As
Icon Animate
Delay (ms)
4000ms

Props

Props accepted by CopyButton.

PropTypeDefaultDescription
contentstring—Text written to the clipboard on click.
textbooleanfalseShow the label text alongside (or via tooltip) the icon.
textAs"inline" | "tooltip""inline"Where to render the label when `text` is true.
revealAnimatebooleantrueWhen the inline label swaps, wipe it with RevealAnimate (old text wipes toward the icon, new text wipes out). Disable for an instant swap.
iconAnimate"blur" | "draw" | "reveal""blur"Icon swap animation. `blur` (default) = scale + opacity + blur; `draw` = stroke-dashoffset draw-in (same technique as the Checkbox indicator); `reveal` = RevealAnimate mask wipe.
labelstring"Copy"Label text (rendered inline or inside the tooltip).
copiedLabelstring"Copied"Label swapped in while in the copied state.
delaynumber4000How long the copied state lingers before reverting (ms).
copiedboolean—Controlled copied state. Leave undefined for uncontrolled.
onCopiedChange(copied: boolean) => void—Fires whenever the copied state changes.
classNamestring—Extra class names merged onto the button.

Installation

Choose CLI for the one-line shadcn install, or copy the file manually.

npx shadcn@latest add https://2lazyui.com/r/copy-button.json

Usage

Import the component and drop it into a render.

demo.tsx19 lines
import { CopyButton } from "@/components/lazy-ui/copy-button";

export function Demo() {
  return (
    <>
      {/* Icon only (default) */}
      <CopyButton content="npm install lazy-ui" />

      {/* Inline label with RevealAnimate wipe */}
      <CopyButton content="npm install lazy-ui" text label="Copy" />

      {/* Tooltip label on hover */}
      <CopyButton content="npm install lazy-ui" text textAs="tooltip" />

      {/* Pick a different icon animation */}
      <CopyButton content="npm install lazy-ui" iconAnimate="reveal" />
    </>
  );
}

Credits

Animate UIReference point for compact motion-first copy actions.Clipboard APINative clipboard write used by the button action.
Registryv0.1
Animated TabsNavigationCopy ButtonButtonsGitHub Stars ButtonButtonsReveal AnimateEffectsCounterAnimateShiny TextText AnimateText WarpText AnimateText RiseText AnimateText SpinText AnimateText ScrambleText AnimateSpinning TextText AnimateText FlipText AnimateProgressFeedbackSwitchFormsGlass ButtonButtonsCheckboxFormsiPhoneDevice MocksCircle CipherEffectsLiquid RevealAnimateLiquid TransitionAnimateWave CipherBackgroundHorizon CipherBackgroundOrbit CipherBackgroundOrbit BloomBackgroundOrbit MeshBackgroundMatrix GridAnimateParticle HaloAnimateAurora MeshBackgroundChroma FlowBackgroundPrism DriftBackgroundShadow MeshBackgroundSlime BackgroundBackgroundNeumorphismBackgroundRipple SurfaceBackgroundLiquid ChromeBackgroundBling TransitionAnimateAnimate TooltipOverlayPricing · ClassicBlocks · PricingPricing · BentoBlocks · PricingPricing · EditorialBlocks · PricingPricing · MatrixBlocks · PricingPricing · UsageBlocks · Pricing
Browse all 42 components
Up nextRoadmap
DialogPlanned
TabsPlanned
TooltipPlanned
CommandPlanned
Help the project
Star on GitHubSuggest a componentRead the DESIGN.md