HomeDocsComponentsBlocksChartsThemes
Introduction
  • Introduction
  • Installation
  • Themes
  • llms.txt
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Amount
  • Aspect Ratio
  • Audio Player
  • Avatar
  • Avatar Upload
  • Badge
  • Banner
  • Breadcrumb
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Code Block
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy Button
  • Countdown
  • Data Grid
  • Data Table
  • Date Picker
  • Date Range Picker
  • Description List
  • Device Mockup
  • Dialog
  • Direction
  • Dot Loader
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • File Upload
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Label
  • Menubar
  • Meter
  • Multi Select
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Password Strength
  • Phone Input
  • Popover
  • Progress
  • Progress Circle
  • Radio Group
  • Rating
  • Resizable
  • Responsive Dialog
  • Rich Text Editor
  • Scroll Area
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Sortable
  • Spinner
  • Stat
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag Input
  • Terminal
  • Textarea
  • Time Field
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree
  • Typography
  • Video Player
  • Window Mockup
AI
  • Message Scroller
  • Message
  • Bubble
  • Marker
  • Attachment
  • Questionnaire
  • Composer
  • Reasoning
  • Tool Call
  • Approval Card
  • Citations
Blocks
  • Airtable
  • Airtable Kanban
  • ClickUp List
  • ClickUp Kanban
  • Repeatable Group
  • Command Palette
  • Sign In and Sign Up
  • Availability Scheduler
  • AI Chat
  • Action Bar
  • Notion
  • Banking
  • Lineup Builder
  • Sports Score
  • Strava
  • Sheets
  • Notices
  • Settings
  • Billing
Utilities
  • motion
  • sounds
  • scroll-fade
  • shimmer
Another UI. Built on shadcn/ui with Phosphor icons.

Copy Button

PreviousNext

A button that copies a value to the clipboard and swaps to a check for a moment, with an optional Copy and Copied label.

Base UIReact AriaRadix UI
API keysk_live_7Hq2Lm9xVt4RcB8n
Transit, institution and account00120 004 1234567

Installation#

pnpm dlx shadcn@latest add https://anotherui.dev/r/copy-button.json

Usage#

import { CopyButton } from "@/components/ui/copy-button"
<CopyButton value="https://pay.vwork.digital/i/INV-2026-0418" />
 
<CopyButton value={apiKey} label variant="outline" />

Motion#

The copy icon swaps to a bold check with the shared icon swap. With label, the text swaps from Copy to Copied using the transitions.dev text states swap: the old word leaves upward and the new one rises in. Both swap back after timeout. The success cue plays on copy.

Notes#

  • value can be a function, so the text is read at click time.
  • A blocked clipboard, such as inside some iframes, still shows the feedback. onCopy receives a second argument that says whether the copy worked.
  • Icon-only buttons get their name from the tooltip text. Pass tooltip={false} to drop the Tooltip.

Props#

  • value is the text to copy, or a function that returns it.
  • label shows the text next to the icon. copyLabel and copiedLabel change the words.
  • timeout is how long the check stays, in ms. It defaults to 2000.
  • tooltip wraps the button in a Tooltip. It defaults to true.
  • onCopy runs after each copy. Every other Button prop passes through, and variant defaults to ghost.
Context MenuCountdown

On This Page

InstallationUsageMotionNotesProps